From a0216584b0d9e22f133535375f05a19b92f9b5b0 Mon Sep 17 00:00:00 2001 From: Dinnerbone Date: Tue, 20 Sep 2011 19:10:06 +0100 Subject: [PATCH] Return OfflinePlayer for offline wolf tamers. Thanks robinjam --- src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java index d8622f2969..fc00141f61 100644 --- a/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java +++ b/src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java @@ -43,9 +43,12 @@ public class CraftWolf extends CraftAnimals implements Wolf { public AnimalTamer getOwner() { // If the wolf has a previously set owner use that, otherwise try and find the player who owns it - if (owner == null) { - // TODO try and recover owner from persistence store before defaulting to playername + if (owner == null && !("").equals(getOwnerName())) { owner = getServer().getPlayer(getOwnerName()); + + if (owner == null) { + owner = getServer().getOfflinePlayer(getOwnerName()); + } } return owner; }