Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 13:00:06 +01:00
Implement API for Skeleton and Zombie types. Fixes BUKKIT-2818
Dieser Commit ist enthalten in:
Ursprung
dca54ff187
Commit
bd0868ae1e
@ -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);
|
||||
}
|
||||
}
|
||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren