diff options
author | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-20 19:10:06 +0100 |
---|---|---|
committer | Dinnerbone <dinnerbone@dinnerbone.com> | 2011-09-20 19:10:06 +0100 |
commit | a0216584b0d9e22f133535375f05a19b92f9b5b0 (patch) | |
tree | e497bbe418ae5ff025e5ae263e0438252d66bfd4 /src/main | |
parent | 2d1d86b77e1e3a8612718bb0c523aa90c58ee900 (diff) | |
download | craftbukkit-a0216584b0d9e22f133535375f05a19b92f9b5b0.tar craftbukkit-a0216584b0d9e22f133535375f05a19b92f9b5b0.tar.gz craftbukkit-a0216584b0d9e22f133535375f05a19b92f9b5b0.tar.lz craftbukkit-a0216584b0d9e22f133535375f05a19b92f9b5b0.tar.xz craftbukkit-a0216584b0d9e22f133535375f05a19b92f9b5b0.zip |
Return OfflinePlayer for offline wolf tamers. Thanks robinjam
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/entity/CraftWolf.java | 7 |
1 files 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 d8622f29..fc00141f 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; } |