Implemented new 1.2 entities - this fixes BUKKIT-872 and BUKKIT-885

This commit is contained in:
Nathan Adams
2012-03-01 18:02:16 +00:00
parent 5108569383
commit f1f9802ded
9 changed files with 213 additions and 100 deletions

View File

@@ -0,0 +1,32 @@
package org.bukkit.craftbukkit.entity;
import net.minecraft.server.EntityOcelot;
import org.apache.commons.lang.Validate;
import org.bukkit.craftbukkit.CraftServer;
import org.bukkit.entity.EntityType;
import org.bukkit.entity.Ocelot;
public class CraftOcelot extends CraftTameableAnimal implements Ocelot {
public CraftOcelot(CraftServer server, EntityOcelot wolf) {
super(server, wolf);
}
@Override
public EntityOcelot getHandle() {
return (EntityOcelot) entity;
}
public Type getCatType() {
return Type.getType(getHandle().getCatType());
}
public void setCatType(Type type) {
Validate.notNull(type, "Cat type cannot be null");
getHandle().setCatType(type.getId());
}
@Override
public EntityType getType() {
return EntityType.OCELOT;
}
}