From 8c447e8839bb74388928158c6a1d66494d2e04e1 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Sat, 2 Jul 2011 22:15:06 -0400 Subject: [PATCH] Implemented pig zombie get/set anger functions. By: Celtic Minstrel --- .../craftbukkit/entity/CraftPigZombie.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java index be0a540128..f3087eba4a 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java +++ b/paper-server/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; + } + }