Implemented new 1.2 entities - this fixes BUKKIT-872 and BUKKIT-885
This commit is contained in:
32
src/main/java/org/bukkit/craftbukkit/entity/CraftOcelot.java
Normal file
32
src/main/java/org/bukkit/craftbukkit/entity/CraftOcelot.java
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user