Skip to content

Commit

Permalink
Check for ID mapping null
Browse files Browse the repository at this point in the history
  • Loading branch information
fullwall committed Aug 5, 2013
1 parent 71863c9 commit fd21956
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/main/java/net/citizensnpcs/util/NMS.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,10 +118,6 @@ public static void clearGoals(PathfinderGoalSelector... goalSelectors) {
}
}

public static void openHorseScreen(Horse horse, Player equipper) {
((EntityHorse) getHandle(horse)).f((EntityHuman) NMS.getHandle(equipper));
}

private static Constructor<?> getCustomEntityConstructor(Class<?> clazz, EntityType type) throws SecurityException,
NoSuchMethodException {
Constructor<?> constructor = ENTITY_CONSTRUCTOR_CACHE.get(clazz);
Expand Down Expand Up @@ -215,8 +211,12 @@ public static void mount(org.bukkit.entity.Entity entity, org.bukkit.entity.Enti
NMS.getHandle(passenger).mount(NMS.getHandle(entity));
}

public static void openHorseScreen(Horse horse, Player equipper) {
((EntityHorse) getHandle(horse)).f((EntityHuman) NMS.getHandle(equipper));
}

public static void registerEntityClass(Class<?> clazz) {
if (ENTITY_CLASS_TO_INT.containsKey(clazz))
if (ENTITY_CLASS_TO_INT == null || ENTITY_CLASS_TO_INT.containsKey(clazz))
return;
Class<?> search = clazz;
while ((search = search.getSuperclass()) != null && Entity.class.isAssignableFrom(search)) {
Expand Down

0 comments on commit fd21956

Please sign in to comment.