mirror of
https://github.com/PurpurMC/Purpur.git
synced 2026-02-18 08:57:44 +01:00
Small fixes to rabid wolves patch
This commit is contained in:
@@ -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<EntityLiving> RABID_PREDICATE = e -> e instanceof EntityPlayer || e instanceof EntityInsentient;
|
||||
+ private static final Predicate<EntityLiving> 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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user