diff --git a/src/de/steamwar/bungeecore/listeners/BanListener.java b/src/de/steamwar/bungeecore/listeners/BanListener.java index bc56de32..c9aadb73 100644 --- a/src/de/steamwar/bungeecore/listeners/BanListener.java +++ b/src/de/steamwar/bungeecore/listeners/BanListener.java @@ -47,15 +47,6 @@ public class BanListener extends BasicListener { List ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress()); if(!ips.isEmpty()){ - if(ips.stream().anyMatch(bannedUserIPs -> bannedUserIPs.getUserID() == user.getId())) { - ips.forEach(bannedUserIPs -> { - if(bannedUserIPs.getUserID() == user.getId()) - bannedUserIPs.remove(); - }); - ips.removeIf(bannedUserIPs -> bannedUserIPs.getUserID() == user.getId()); - if(ips.isEmpty()) - return; - } StringBuilder potentialBan = new StringBuilder(); potentialBan.append(BungeeCore.CHAT_PREFIX); potentialBan.append("§cMögliche Bannumgehung durch §r"); diff --git a/src/de/steamwar/bungeecore/sql/SteamwarUser.java b/src/de/steamwar/bungeecore/sql/SteamwarUser.java index b1e723fe..8fc30fe4 100644 --- a/src/de/steamwar/bungeecore/sql/SteamwarUser.java +++ b/src/de/steamwar/bungeecore/sql/SteamwarUser.java @@ -151,7 +151,11 @@ public class SteamwarUser { public boolean isBanned() { if(!punishments.containsKey(Punishment.PunishmentType.Ban)) return false; - return isCurrent(punishments.get(Punishment.PunishmentType.Ban)); + if(!isCurrent(punishments.get(Punishment.PunishmentType.Ban))) { + SQL.update("DELETE FROM BannedUserIPs WHERE UserID = ?", id); + return false; + } + return true; } public boolean isMuted(){