Fix ClassCastException when an animal's tamer is an OfflinePlayer. Fixes #25, #37, and #39.

This commit is contained in:
zml2008 2012-07-25 21:15:14 -07:00
parent bc8cdd2814
commit 81a6a897ef

View File

@ -70,7 +70,7 @@ public abstract class ModifyworldListener implements Listener {
} else if (entity instanceof Tameable) {
Tameable animal = (Tameable) entity;
return "animal." + entityName + (animal.isTamed() ? "." + ((Player) animal.getOwner()).getName() : "");
return "animal." + entityName + (animal.isTamed() ? "." + animal.getOwner().getName() : "");
}