diff options
Diffstat (limited to 'src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java')
-rw-r--r-- | src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java index 237837d7..1328c175 100644 --- a/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java +++ b/src/main/java/org/bukkit/craftbukkit/CraftOfflinePlayer.java @@ -90,14 +90,22 @@ public class CraftOfflinePlayer implements OfflinePlayer, ConfigurationSerializa } public boolean isBanned() { - return server.getBanList(BanList.Type.UUID).isBanned(getUniqueId().toString()); + if (getName() == null) { + return false; + } + + return server.getBanList(BanList.Type.NAME).isBanned(getName()); } public void setBanned(boolean value) { + if (getName() == null) { + return; + } + if (value) { - server.getBanList(BanList.Type.UUID).addBan(getUniqueId().toString(), null, null, null); + server.getBanList(BanList.Type.NAME).addBan(getName(), null, null, null); } else { - server.getBanList(BanList.Type.UUID).pardon(getUniqueId().toString()); + server.getBanList(BanList.Type.NAME).pardon(getName()); } } |