mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-24 11:38:29 +01:00
Return OfflinePlayer for offline wolf tamers. Thanks robinjam
This commit is contained in:
parent
2d1d86b77e
commit
a0216584b0
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user