summaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
authorDinnerbone <dinnerbone@dinnerbone.com>2011-09-20 19:10:06 +0100
committerDinnerbone <dinnerbone@dinnerbone.com>2011-09-20 19:10:06 +0100
commita0216584b0d9e22f133535375f05a19b92f9b5b0 (patch)
treee497bbe418ae5ff025e5ae263e0438252d66bfd4 /src/main
parent2d1d86b77e1e3a8612718bb0c523aa90c58ee900 (diff)
downloadcraftbukkit-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.java7
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;
}