From 4e8ec15953d27fcda7abef127bc6d5c7676fe325 Mon Sep 17 00:00:00 2001 From: CraftBukkit/Spigot Date: Mon, 5 Nov 2012 18:09:40 +0000 Subject: [PATCH] Implement API for Skeleton and Zombie types. Fixes BUKKIT-2818 By: James Clarke --- .../bukkit/craftbukkit/entity/CraftSkeleton.java | 10 ++++++++++ .../bukkit/craftbukkit/entity/CraftZombie.java | 16 ++++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java index 3093341456..58da899412 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftSkeleton.java +++ b/paper-server/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/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java b/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java index 12139e3118..619579d4ac 100644 --- a/paper-server/src/main/java/org/bukkit/craftbukkit/entity/CraftZombie.java +++ b/paper-server/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); + } }