mirror of
https://github.com/PaperMC/Paper.git
synced 2025-01-09 19:49:35 +01:00
Fall back to name if skull has no uuid when getting player.
By: md_5 <git@md-5.net>
This commit is contained in:
parent
3aa2d8025a
commit
234b54be67
1 changed files with 11 additions and 1 deletions
|
@ -181,7 +181,17 @@ public class CraftSkull extends CraftBlockState implements Skull {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public OfflinePlayer getOwningPlayer() {
|
public OfflinePlayer getOwningPlayer() {
|
||||||
return hasOwner() ? Bukkit.getOfflinePlayer(profile.getId()) : null;
|
if (profile != null) {
|
||||||
|
if (profile.getId() != null) {
|
||||||
|
return Bukkit.getOfflinePlayer(profile.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (profile.getName() != null) {
|
||||||
|
return Bukkit.getOfflinePlayer(profile.getName());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
Loading…
Reference in a new issue