Let's handle (bwhaha) the Craft* entities a bit better.

This commit is contained in:
Erik Broes
2011-03-01 17:08:18 +01:00
parent e6583c0d48
commit f54469f314
8 changed files with 52 additions and 53 deletions

View File

@@ -7,24 +7,26 @@ import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Sheep;
public class CraftSheep extends CraftAnimals implements Sheep {
public CraftSheep(CraftServer server, EntitySheep entity) {
super(server, entity);
}
@Override
public EntitySheep getHandle() {
return (EntitySheep) entity;
}
@Override
public String toString() {
return "CraftSheep";
}
public DyeColor getColor() {
EntitySheep entity = (EntitySheep) getHandle();
return DyeColor.getByData((byte) entity.n());
return DyeColor.getByData((byte) getHandle().n());
}
public void setColor(DyeColor color) {
EntitySheep entity = (EntitySheep) getHandle();
entity.a_(color.getData());
getHandle().a_(color.getData());
}
}