From 7ae605218b9f458ab514ce19ad892b6453119188 Mon Sep 17 00:00:00 2001 From: md_5 Date: Fri, 22 Jul 2016 12:02:16 +1000 Subject: [PATCH] Fall back to name if skull has no uuid when getting player. --- .../org/bukkit/craftbukkit/block/CraftSkull.java | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java index 632d63172b..89e4e72570 100644 --- a/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java +++ b/src/main/java/org/bukkit/craftbukkit/block/CraftSkull.java @@ -181,7 +181,17 @@ public class CraftSkull extends CraftBlockState implements Skull { @Override 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