clean up level/getWorld usage in various patches

This commit is contained in:
BillyGalbreath
2022-03-08 13:53:45 -06:00
parent 1713e8a292
commit e9af29e2c6
6 changed files with 17 additions and 17 deletions

View File

@@ -5,7 +5,7 @@ Subject: [PATCH] Dolphins naturally aggressive to players chance
diff --git a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
index 3cc3539f0664eeb048290f4d9b229a5d674fff3c..ce86a56da5aaf65a34352eab1da20e4340175248 100644
index 3cc3539f0664eeb048290f4d9b229a5d674fff3c..f41aadb12c2d661014c488b4fc52298668c95da0 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Dolphin.java
@@ -79,6 +79,7 @@ public class Dolphin extends WaterAnimal {
@@ -20,7 +20,7 @@ index 3cc3539f0664eeb048290f4d9b229a5d674fff3c..ce86a56da5aaf65a34352eab1da20e43
public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType spawnReason, @Nullable SpawnGroupData entityData, @Nullable CompoundTag entityNbt) {
this.setAirSupply(this.getMaxAirSupply());
this.setXRot(0.0F);
+ this.isNaturallyAggressiveToPlayers = level.purpurConfig.dolphinNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= level.purpurConfig.dolphinNaturallyAggressiveToPlayersChance; // Purpur
+ this.isNaturallyAggressiveToPlayers = world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.dolphinNaturallyAggressiveToPlayersChance; // Purpur
return super.finalizeSpawn(world, difficulty, spawnReason, entityData, entityNbt);
}