Skip to content

Commit

Permalink
fixed issue #67
Browse files Browse the repository at this point in the history
  • Loading branch information
mung3r committed Apr 19, 2014
1 parent 8f0260e commit 6546652
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/main/java/com/edwardhand/mobrider/ConfigManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,11 @@ public ConfigManager(MobRider plugin)
ConfigurationSection mobs = config.getConfigurationSection("mobs");
for (String name : mobs.getKeys(false)) {
ConfigurationSection mob = mobs.getConfigurationSection(name);
new RideType(EntityType.fromName(name), Double.valueOf(mob.getDouble("speed")).floatValue(), mob.getString("noise"), mob.getDouble("chance"),
mob.getDouble("cost"));
EntityType type = EntityType.fromName(name);
if (type != null) {
new RideType(type, Double.valueOf(mob.getDouble("speed")).floatValue(), mob.getString("noise"), mob.getDouble("chance"),
mob.getDouble("cost"));
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ public static void sendMessage(Rider rider, String suffix)
Player player = rider.getPlayer();
LivingEntity ride = rider.getRide();

if (player != null && ride != null && !(ride instanceof HumanEntity)) {
if (player != null && ride != null && rider.getRideType() != null && !(ride instanceof HumanEntity)) {
player.sendMessage("<" + getHealthString(rider) + "§e" + ride.getType().getName() + "§f> " + rider.getRideType().getNoise() + suffix);
}
}
Expand Down

0 comments on commit 6546652

Please sign in to comment.