From b4be9ab44e5dff2e0e4e7eeee177bfacd0c3532e Mon Sep 17 00:00:00 2001 From: BillyGalbreath Date: Wed, 9 Dec 2020 19:45:36 -0600 Subject: [PATCH] Small fixes to rabid wolves patch --- patches/server/0161-Wolf-naturally-spawn-rabid.patch | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/patches/server/0161-Wolf-naturally-spawn-rabid.patch b/patches/server/0161-Wolf-naturally-spawn-rabid.patch index 7c21146f7..e1d43c769 100644 --- a/patches/server/0161-Wolf-naturally-spawn-rabid.patch +++ b/patches/server/0161-Wolf-naturally-spawn-rabid.patch @@ -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/server/EntityWolf.java b/src/main/java/net/minecraft/server/EntityWolf.java -index 6c25f667ee..7149b10e4a 100644 +index 6c25f667ee..adbc3ec480 100644 --- a/src/main/java/net/minecraft/server/EntityWolf.java +++ b/src/main/java/net/minecraft/server/EntityWolf.java @@ -14,11 +14,17 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable @@ -22,7 +22,7 @@ index 6c25f667ee..7149b10e4a 100644 }; + // Purpur start - rabid wolf spawn chance + private boolean isRabid = false; -+ private static final Predicate RABID_PREDICATE = e -> e instanceof EntityPlayer || e instanceof EntityInsentient; ++ private static final Predicate RABID_PREDICATE = e -> e instanceof EntityPlayer || (e instanceof EntityInsentient && e.getEntityType() != EntityTypes.WOLF); + private final PathfinderGoal PATHFINDER_VANILLA = new PathfinderGoalRandomTargetNonTamed<>(this, EntityAnimal.class, false, vanillaPredicate()); + private final PathfinderGoal PATHFINDER_RABID = new PathfinderGoalRandomTargetNonTamed<>(this, EntityLiving.class, false, RABID_PREDICATE); + // Purpur end @@ -80,15 +80,11 @@ index 6c25f667ee..7149b10e4a 100644 this.c(nbttagcompound); } -@@ -128,6 +162,11 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable +@@ -128,6 +162,7 @@ public class EntityWolf extends EntityTameableAnimal implements IEntityAngerable if (nbttagcompound.hasKeyOfType("CollarColor", 99)) { this.setCollarColor(EnumColor.fromColorIndex(nbttagcompound.getInt("CollarColor"))); } -+ // Purpur start - rabid wolf spawn chance -+ if (nbttagcompound.hasKeyOfType("Purpur.IsRabid", 99)) { -+ setRabid(nbttagcompound.getBoolean("Purpur.IsRabid")); -+ } -+ // Purpur end ++ setRabid(nbttagcompound.getBoolean("Purpur.IsRabid")); // Purpur end this.a((WorldServer) this.world, nbttagcompound); }