From 039088e974f079d44659ae7c404981a6bbb0d10f Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Thu, 1 Mar 2012 17:29:05 +0000 Subject: Added a bunch of new 1.2 entities; this partially resolves BUKKIT-872 and BUKKIT-885. --- src/main/java/org/bukkit/entity/EntityType.java | 3 ++ src/main/java/org/bukkit/entity/Golem.java | 8 +++ src/main/java/org/bukkit/entity/IronGolem.java | 8 +++ src/main/java/org/bukkit/entity/Ocelot.java | 57 ++++++++++++++++++++++ src/main/java/org/bukkit/entity/Snowman.java | 2 +- .../java/org/bukkit/entity/ThrownExpBottle.java | 8 +++ 6 files changed, 85 insertions(+), 1 deletion(-) create mode 100644 src/main/java/org/bukkit/entity/Golem.java create mode 100644 src/main/java/org/bukkit/entity/IronGolem.java create mode 100644 src/main/java/org/bukkit/entity/Ocelot.java create mode 100644 src/main/java/org/bukkit/entity/ThrownExpBottle.java (limited to 'src') diff --git a/src/main/java/org/bukkit/entity/EntityType.java b/src/main/java/org/bukkit/entity/EntityType.java index e6b51e7f..42f2dccd 100644 --- a/src/main/java/org/bukkit/entity/EntityType.java +++ b/src/main/java/org/bukkit/entity/EntityType.java @@ -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. diff --git a/src/main/java/org/bukkit/entity/Golem.java b/src/main/java/org/bukkit/entity/Golem.java new file mode 100644 index 00000000..4165977e --- /dev/null +++ b/src/main/java/org/bukkit/entity/Golem.java @@ -0,0 +1,8 @@ +package org.bukkit.entity; + +/** + * A mechanical creature that may harm enemies. + */ +public interface Golem extends Creature { + +} diff --git a/src/main/java/org/bukkit/entity/IronGolem.java b/src/main/java/org/bukkit/entity/IronGolem.java new file mode 100644 index 00000000..16a35e68 --- /dev/null +++ b/src/main/java/org/bukkit/entity/IronGolem.java @@ -0,0 +1,8 @@ +package org.bukkit.entity; + +/** + * An iron Golem that protects Villages. + */ +public interface IronGolem extends Golem { + +} diff --git a/src/main/java/org/bukkit/entity/Ocelot.java b/src/main/java/org/bukkit/entity/Ocelot.java new file mode 100644 index 00000000..54bde9c8 --- /dev/null +++ b/src/main/java/org/bukkit/entity/Ocelot.java @@ -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]; + } + } +} diff --git a/src/main/java/org/bukkit/entity/Snowman.java b/src/main/java/org/bukkit/entity/Snowman.java index 49005ed2..c8070ff2 100644 --- a/src/main/java/org/bukkit/entity/Snowman.java +++ b/src/main/java/org/bukkit/entity/Snowman.java @@ -3,6 +3,6 @@ package org.bukkit.entity; /** * Represents a snowman entity */ -public interface Snowman extends Creature { +public interface Snowman extends Golem { } diff --git a/src/main/java/org/bukkit/entity/ThrownExpBottle.java b/src/main/java/org/bukkit/entity/ThrownExpBottle.java new file mode 100644 index 00000000..671282ed --- /dev/null +++ b/src/main/java/org/bukkit/entity/ThrownExpBottle.java @@ -0,0 +1,8 @@ +package org.bukkit.entity; + +/** + * Represents a thrown Experience bottle. + */ +public interface ThrownExpBottle extends Projectile { + +} -- cgit v1.2.3