forked from LogBlock/LogBlock
Allow minecraft names instead of bukkit names for entities
This commit is contained in:
@@ -946,15 +946,19 @@ public class BukkitUtils {
|
|||||||
private static final HashMap<String, EntityType> types = new HashMap<>();
|
private static final HashMap<String, EntityType> types = new HashMap<>();
|
||||||
static {
|
static {
|
||||||
for (EntityType t : EntityType.values()) {
|
for (EntityType t : EntityType.values()) {
|
||||||
types.put(t.name().toLowerCase(), t);
|
if (t != EntityType.UNKNOWN) {
|
||||||
@SuppressWarnings("deprecation")
|
types.put(t.name().toLowerCase(), t);
|
||||||
String typeName = t.getName();
|
@SuppressWarnings("deprecation")
|
||||||
if (typeName != null) {
|
String typeName = t.getName();
|
||||||
types.put(typeName.toLowerCase(), t);
|
if (typeName != null) {
|
||||||
}
|
types.put(typeName.toLowerCase(), t);
|
||||||
Class<? extends Entity> ec = t.getEntityClass();
|
}
|
||||||
if (ec != null) {
|
Class<? extends Entity> ec = t.getEntityClass();
|
||||||
types.put(ec.getSimpleName().toLowerCase(), t);
|
if (ec != null) {
|
||||||
|
types.put(ec.getSimpleName().toLowerCase(), t);
|
||||||
|
}
|
||||||
|
types.put(t.getKey().getKey(), t);
|
||||||
|
types.put(t.getKey().toString(), t);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user