1 package org.bukkit.entity;
3 import java.util.EnumSet;
4 import java.util.HashMap;
39 private Class<? extends Entity> clazz;
42 private static final Map<String, CreatureType> NAME_MAP =
new HashMap<String, CreatureType>();
43 private static final Map<Short, CreatureType> ID_MAP =
new HashMap<Short, CreatureType>();
47 NAME_MAP.put(type.name, type);
48 if (type.typeId != 0) {
49 ID_MAP.put(type.typeId, type);
54 private CreatureType(String name, Class<? extends Entity> clazz,
int typeId) {
57 this.typeId = (short) typeId;
73 return NAME_MAP.get(name);
77 if (
id > Short.MAX_VALUE) {
80 return ID_MAP.get((
short)
id);
89 return fromName(creatureType.
getName());