diff options
author | Nathan Adams <dinnerbone@dinnerbone.com> | 2011-10-29 08:09:03 +0100 |
---|---|---|
committer | Erik Broes <erikbroes@ripe.net> | 2011-11-19 20:23:27 -0800 |
commit | ea427c302670d21b908c967266fc4ac10b848661 (patch) | |
tree | 9fa9c77aa110e1a88becb043587966cad18d99ed /src | |
parent | 27beb951f09528ea329351654281d03552e9872a (diff) | |
download | bukkit-ea427c302670d21b908c967266fc4ac10b848661.tar bukkit-ea427c302670d21b908c967266fc4ac10b848661.tar.gz bukkit-ea427c302670d21b908c967266fc4ac10b848661.tar.lz bukkit-ea427c302670d21b908c967266fc4ac10b848661.tar.xz bukkit-ea427c302670d21b908c967266fc4ac10b848661.zip |
Added class type to CreatureType enum
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/entity/CreatureType.java | 44 |
1 files changed, 25 insertions, 19 deletions
diff --git a/src/main/java/org/bukkit/entity/CreatureType.java b/src/main/java/org/bukkit/entity/CreatureType.java index 37779b9a..9d2f5686 100644 --- a/src/main/java/org/bukkit/entity/CreatureType.java +++ b/src/main/java/org/bukkit/entity/CreatureType.java @@ -5,26 +5,27 @@ import java.util.HashMap; import java.util.Map; public enum CreatureType { - CHICKEN("Chicken"), - COW("Cow"), - CREEPER("Creeper"), - GHAST("Ghast"), - GIANT("Giant"), - MONSTER("Monster"), - PIG("Pig"), - PIG_ZOMBIE("PigZombie"), - SHEEP("Sheep"), - SKELETON("Skeleton"), - SLIME("Slime"), - SPIDER("Spider"), - SQUID("Squid"), - ZOMBIE("Zombie"), - WOLF("Wolf"), - CAVE_SPIDER("CaveSpider"), - ENDERMAN("Enderman"), - SILVERFISH("Silverfish"); + CHICKEN("Chicken", Chicken.class), + COW("Cow", Cow.class), + CREEPER("Creeper", Creeper.class), + GHAST("Ghast", Ghast.class), + GIANT("Giant", Giant.class), + MONSTER("Monster", Monster.class), + PIG("Pig", Pig.class), + PIG_ZOMBIE("PigZombie", PigZombie.class), + SHEEP("Sheep", Sheep.class), + SKELETON("Skeleton", Skeleton.class), + SLIME("Slime", Slime.class), + SPIDER("Spider", Spider.class), + SQUID("Squid", Squid.class), + ZOMBIE("Zombie", Zombie.class), + WOLF("Wolf", Wolf.class), + CAVE_SPIDER("CaveSpider", CaveSpider.class), + ENDERMAN("Enderman", Enderman.class), + SILVERFISH("Silverfish", Silverfish.class); private String name; + private Class<? extends Entity> clazz; private static final Map<String, CreatureType> mapping = new HashMap<String, CreatureType>(); @@ -34,13 +35,18 @@ public enum CreatureType { } } - private CreatureType(String name) { + private CreatureType(String name, Class<? extends Entity> clazz) { this.name = name; + this.clazz = clazz; } public String getName() { return name; } + + public Class<? extends Entity> getEntityClass() { + return clazz; + } public static CreatureType fromName(String name) { return mapping.get(name); |