Added a bunch of new 1.2 entities; this partially resolves BUKKIT-872 and BUKKIT-885.

By: Nathan Adams <dinnerbone@dinnerbone.com>
This commit is contained in:
Bukkit/Spigot 2012-03-01 17:29:05 +00:00
parent 18c825222a
commit d94ce50c98
6 changed files with 85 additions and 1 deletions

View file

@ -17,6 +17,7 @@ public enum EntityType {
SMALL_FIREBALL("SmallFireball", SmallFireball.class, 13),
ENDER_PEARL("ThrownEnderpearl", EnderPearl.class, 14),
ENDER_SIGNAL("EyeOfEnderSignal", EnderSignal.class, 15),
THROWN_EXP_BOTTLE("ThrownExpBottle", ThrownExpBottle.class, 17),
PRIMED_TNT("PrimedTnt", TNTPrimed.class, 20),
FALLING_BLOCK("FallingSand", FallingSand.class, 21, false),
MINECART("Minecart", Minecart.class, 40),
@ -43,6 +44,8 @@ public enum EntityType {
WOLF("Wolf", Wolf.class, 95),
MUSHROOM_COW("MushroomCow", MushroomCow.class, 96),
SNOWMAN("SnowMan", Snowman.class, 97),
OCELOT("Ozelot", Ocelot.class, 98),
IRON_GOLEM("VillagerGolem", IronGolem.class, 98),
VILLAGER("Villager", Villager.class, 120),
ENDER_CRYSTAL("EnderCrystal", EnderCrystal.class, 200),
// These don't have an entity ID in nms.EntityTypes.

View file

@ -0,0 +1,8 @@
package org.bukkit.entity;
/**
* A mechanical creature that may harm enemies.
*/
public interface Golem extends Creature {
}

View file

@ -0,0 +1,8 @@
package org.bukkit.entity;
/**
* An iron Golem that protects Villages.
*/
public interface IronGolem extends Golem {
}

View file

@ -0,0 +1,57 @@
package org.bukkit.entity;
/**
* A wild tameable cat
*/
public interface Ocelot extends Animals, Tameable {
/**
* Gets the current type of this cat.
*
* @return Type of the cat.
*/
public Type getCatType();
/**
* Sets the current type of this cat.
*
* @param type New type of this cat.
*/
public void setCatType(Type type);
/**
* Represents the various different cat types there are.
*/
public enum Type {
WILD_OCELOT(0),
BLACK_CAT(1),
RED_CAT(2),
SIAMESE_CAT(3);
private static final Type[] types = new Type[Type.values().length];
private final int id;
private Type(int id) {
this.id = id;
}
/**
* Gets the ID of this cat type.
*
* @return Type ID.
*/
public int getId() {
return id;
}
/**
* Gets a cat type by its ID.
*
* @param id ID of the cat type to get.
* @return Resulting type, or null if not found.
*/
public static final Type getType(int id) {
return (id >= types.length) ? null : types[id];
}
}
}

View file

@ -3,6 +3,6 @@ package org.bukkit.entity;
/**
* Represents a snowman entity
*/
public interface Snowman extends Creature {
public interface Snowman extends Golem {
}

View file

@ -0,0 +1,8 @@
package org.bukkit.entity;
/**
* Represents a thrown Experience bottle.
*/
public interface ThrownExpBottle extends Projectile {
}