Andrew Ardill 2759809ecb Fix Craft Entity constructors and toStrings.
Also, standardise getHandle and clean up in general.
getHandle is now using the 'entity' member variable instead of
super.getHandle, as this reduces the number of chained calls needed.
2011-11-29 21:22:35 +11:00

29 lines
640 B
Java

package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityPig;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.Pig;
public class CraftPig extends CraftAnimals implements Pig {
public CraftPig(CraftServer server, EntityPig entity) {
super(server, entity);
}
public boolean hasSaddle() {
return getHandle().hasSaddle();
}
public void setSaddle(boolean saddled) {
getHandle().setSaddle(saddled);
}
public EntityPig getHandle() {
return (EntityPig) entity;
}
@Override
public String toString() {
return "CraftPig";
}
}