diff options
author | James Clarke <jamesrtclarke@me.com> | 2012-11-05 18:09:40 +0000 |
---|---|---|
committer | Travis Watkins <amaranth@ubuntu.com> | 2012-11-17 15:00:14 -0600 |
commit | bd0868ae1e34d4d829dc80984a3b640048ac7a5f (patch) | |
tree | 5d569ac5c26fa76134b7875c9da4e517f01fb269 /src/main | |
parent | dca54ff187fa10f37523ff744b765b66d177967e (diff) | |
download | craftbukkit-bd0868ae1e34d4d829dc80984a3b640048ac7a5f.tar craftbukkit-bd0868ae1e34d4d829dc80984a3b640048ac7a5f.tar.gz craftbukkit-bd0868ae1e34d4d829dc80984a3b640048ac7a5f.tar.lz craftbukkit-bd0868ae1e34d4d829dc80984a3b640048ac7a5f.tar.xz craftbukkit-bd0868ae1e34d4d829dc80984a3b640048ac7a5f.zip |
Implement API for Skeleton and Zombie types. Fixes BUKKIT-2818
Diffstat (limited to 'src/main')
3 files changed, 27 insertions, 1 deletions
diff --git a/src/main/java/net/minecraft/server/EntityZombie.java b/src/main/java/net/minecraft/server/EntityZombie.java index 84c1d115..a0934a25 100644 --- a/src/main/java/net/minecraft/server/EntityZombie.java +++ b/src/main/java/net/minecraft/server/EntityZombie.java @@ -61,7 +61,7 @@ public class EntityZombie extends EntityMonster { } public void setBaby(boolean flag) { - this.getDataWatcher().watch(12, Byte.valueOf((byte) 1)); + this.getDataWatcher().watch(12, Byte.valueOf((byte) (flag ? 1 : 0))); // CraftBukkit - added flag } public boolean isVillager() { diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java index 30933414..58da8994 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java @@ -2,6 +2,7 @@ package org.bukkit.craftbukkit.entity; import net.minecraft.server.EntitySkeleton; +import org.apache.commons.lang.Validate; import org.bukkit.craftbukkit.CraftServer; import org.bukkit.entity.EntityType; import org.bukkit.entity.Skeleton; @@ -25,4 +26,13 @@ public class CraftSkeleton extends CraftMonster implements Skeleton { public EntityType getType() { return EntityType.SKELETON; } + + public SkeletonType getSkeletonType() { + return SkeletonType.getType(getHandle().getSkeletonType()); + } + + public void setSkeletonType(SkeletonType type) { + Validate.notNull(type); + getHandle().setSkeletonType(type.getId()); + } } diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java index 12139e31..619579d4 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java @@ -25,4 +25,20 @@ public class CraftZombie extends CraftMonster implements Zombie { public EntityType getType() { return EntityType.ZOMBIE; } + + public boolean isBaby() { + return getHandle().isBaby(); + } + + public void setBaby(boolean flag) { + getHandle().setBaby(flag); + } + + public boolean isVillager() { + return getHandle().isVillager(); + } + + public void setVillager(boolean flag) { + getHandle().setVillager(flag); + } } |