If Bukkit doesn't know who a player is, but we do, substitute the last known nickname when ban checking.

This commit is contained in:
KHobbits 2014-05-10 21:44:27 +01:00
parent 0d6bca2080
commit 4ecb6b5fdb

View File

@ -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);
}