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

@@ -7,7 +7,7 @@ Configurable chance to spawn a wolf that is rabid.
Rabid wolves attack all players, mobs, and animals.
diff --git a/src/main/java/net/minecraft/world/entity/animal/Wolf.java b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
index ed6a552fab01b1391cf98fdbb51f7f47f72de932..cbd5f90f5005187c61e47e6f6fa74fb19d67a4d4 100644
index ed6a552fab01b1391cf98fdbb51f7f47f72de932..ae2ee87ccf3bf547750e8ed7c98029ed9de4806d 100644
--- a/src/main/java/net/minecraft/world/entity/animal/Wolf.java
+++ b/src/main/java/net/minecraft/world/entity/animal/Wolf.java
@@ -11,15 +11,19 @@ import net.minecraft.network.syncher.EntityDataAccessor;
@@ -123,7 +123,7 @@ index ed6a552fab01b1391cf98fdbb51f7f47f72de932..cbd5f90f5005187c61e47e6f6fa74fb1
+
+ @Override
+ public SpawnGroupData finalizeSpawn(ServerLevelAccessor world, DifficultyInstance difficulty, MobSpawnType type, @Nullable SpawnGroupData data, @Nullable CompoundTag nbt) {
+ this.isRabid = level.purpurConfig.wolfNaturalRabid > 0.0D && random.nextDouble() <= level.purpurConfig.wolfNaturalRabid;
+ this.isRabid = world.getLevel().purpurConfig.wolfNaturalRabid > 0.0D && random.nextDouble() <= world.getLevel().purpurConfig.wolfNaturalRabid;
+ this.updatePathfinders(false);
+ return super.finalizeSpawn(world, difficulty, type, data, nbt);
+ }