From 81a6a897efafabc50b32f2ca10d32d48f2bde90a Mon Sep 17 00:00:00 2001 From: zml2008 Date: Wed, 25 Jul 2012 21:15:14 -0700 Subject: [PATCH] Fix ClassCastException when an animal's tamer is an OfflinePlayer. Fixes #25, #37, and #39. --- src/main/java/ru/tehkode/modifyworld/ModifyworldListener.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/ru/tehkode/modifyworld/ModifyworldListener.java b/src/main/java/ru/tehkode/modifyworld/ModifyworldListener.java index 559b2ea..bc71b8f 100644 --- a/src/main/java/ru/tehkode/modifyworld/ModifyworldListener.java +++ b/src/main/java/ru/tehkode/modifyworld/ModifyworldListener.java @@ -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() : ""); } @@ -141,7 +141,7 @@ public abstract class ModifyworldListener implements Listener { if (obj == null) { continue; } - + builder.append('.'); builder.append(getObjectPermission(obj)); }