diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java index 37223bb434..1e3b524689 100644 --- a/src/main/java/net/minecraft/server/EntityPigZombie.java +++ b/src/main/java/net/minecraft/server/EntityPigZombie.java @@ -9,7 +9,7 @@ import org.bukkit.event.entity.EntityTargetEvent; public class EntityPigZombie extends EntityZombie { - private int angerLevel = 0; + public int angerLevel = 0; // CraftBukkit - private -> public private int soundDelay = 0; private static final ItemStack f = new ItemStack(Item.GOLD_SWORD, 1); diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java index be0a540128..f3087eba4a 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java @@ -11,9 +11,30 @@ public class CraftPigZombie extends CraftZombie implements PigZombie { super(server, entity); } + @Override + public EntityPigZombie getHandle() { + return (EntityPigZombie) super.getHandle(); + } + @Override public String toString() { return "CraftPigZombie"; } + public int getAnger() { + return getHandle().angerLevel; + } + + public void setAnger(int level) { + getHandle().angerLevel = level; + } + + public void setAngry(boolean angry) { + setAnger(angry ? 400 : 0); + } + + public boolean isAngry() { + return getAnger() > 0; + } + }