geforkt von Mirrors/Paper
Return OfflinePlayer for offline wolf tamers. Thanks robinjam
Dieser Commit ist enthalten in:
Ursprung
2d1d86b77e
Commit
a0216584b0
@ -43,9 +43,12 @@ public class CraftWolf extends CraftAnimals implements Wolf {
|
|||||||
|
|
||||||
public AnimalTamer getOwner() {
|
public AnimalTamer getOwner() {
|
||||||
// If the wolf has a previously set owner use that, otherwise try and find the player who owns it
|
// If the wolf has a previously set owner use that, otherwise try and find the player who owns it
|
||||||
if (owner == null) {
|
if (owner == null && !("").equals(getOwnerName())) {
|
||||||
// TODO try and recover owner from persistence store before defaulting to playername
|
|
||||||
owner = getServer().getPlayer(getOwnerName());
|
owner = getServer().getPlayer(getOwnerName());
|
||||||
|
|
||||||
|
if (owner == null) {
|
||||||
|
owner = getServer().getOfflinePlayer(getOwnerName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return owner;
|
return owner;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren