summaryrefslogtreecommitdiffstats
path: root/src/main/java
diff options
context:
space:
mode:
authorCeltic Minstrel <celtic.minstrel.ca@>2011-07-02 22:15:06 -0400
committerEvilSeph <evilseph@gmail.com>2011-07-14 14:58:12 -0400
commitcc94325b285e548c3f692b35d920348bbb781d1a (patch)
tree1bb749fa3dec2cec317af8a2b36452478b960e61 /src/main/java
parentc9979169b953816e5fe4449c4ee7cd5475577a24 (diff)
downloadcraftbukkit-cc94325b285e548c3f692b35d920348bbb781d1a.tar
craftbukkit-cc94325b285e548c3f692b35d920348bbb781d1a.tar.gz
craftbukkit-cc94325b285e548c3f692b35d920348bbb781d1a.tar.lz
craftbukkit-cc94325b285e548c3f692b35d920348bbb781d1a.tar.xz
craftbukkit-cc94325b285e548c3f692b35d920348bbb781d1a.zip
Implemented pig zombie get/set anger functions.
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/net/minecraft/server/EntityPigZombie.java2
-rw-r--r--src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java21
2 files changed, 22 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityPigZombie.java b/src/main/java/net/minecraft/server/EntityPigZombie.java
index 37223bb4..1e3b5246 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 be0a5401..f3087eba 100644
--- a/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java
+++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftPigZombie.java
@@ -12,8 +12,29 @@ public class CraftPigZombie extends CraftZombie implements PigZombie {
}
@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;
+ }
+
}