mirror of
https://github.com/PaperMC/Paper.git
synced 2024-12-02 04:56:50 +01:00
Implement API for Skeleton and Zombie types. Fixes BUKKIT-2818
This commit is contained in:
parent
dca54ff187
commit
bd0868ae1e
3 changed files with 27 additions and 1 deletions
|
@ -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() {
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue