From 4ecb6b5fdba8857f305c92a74394759b214ee813 Mon Sep 17 00:00:00 2001 From: KHobbits Date: Sat, 10 May 2014 21:44:27 +0100 Subject: [PATCH] If Bukkit doesn't know who a player is, but we do, substitute the last known nickname when ban checking. --- .../com/earth2me/essentials/OfflinePlayer.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java index 7e92d46a2..2fda39778 100644 --- a/Essentials/src/com/earth2me/essentials/OfflinePlayer.java +++ b/Essentials/src/com/earth2me/essentials/OfflinePlayer.java @@ -1481,12 +1481,27 @@ public class OfflinePlayer implements Player @Override public boolean isBanned() { + if (base.getName() == null && getName() != null) + { + return server.getBanList(BanList.Type.NAME).isBanned(getName()); + } return base.isBanned(); } @Override public void setBanned(boolean banned) { + if (base.getName() == null && getName() != null) + { + if (banned) + { + server.getBanList(BanList.Type.NAME).addBan(getName(), null, null, null); + } + else + { + server.getBanList(BanList.Type.NAME).pardon(getName()); + } + } base.setBanned(banned); }