From a5dc11cac188058726e272f04037b2163cdd6103 Mon Sep 17 00:00:00 2001 From: Lixfel Date: Sat, 19 Dec 2020 12:08:18 +0100 Subject: [PATCH] Fix bannumgehungs timings Signed-off-by: Lixfel --- src/de/steamwar/bungeecore/listeners/BanListener.java | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/de/steamwar/bungeecore/listeners/BanListener.java b/src/de/steamwar/bungeecore/listeners/BanListener.java index 810e95a0..9c8b85c7 100644 --- a/src/de/steamwar/bungeecore/listeners/BanListener.java +++ b/src/de/steamwar/bungeecore/listeners/BanListener.java @@ -33,7 +33,6 @@ import net.md_5.bungee.api.event.LoginEvent; import net.md_5.bungee.event.EventHandler; import java.sql.Timestamp; -import java.time.Instant; import java.time.format.DateTimeFormatter; import java.util.List; @@ -52,7 +51,7 @@ public class BanListener extends BasicListener { List ips = BannedUserIPs.get(event.getConnection().getAddress().getAddress().getHostAddress()); if(!ips.isEmpty()){ - Timestamp highestBan = Timestamp.from(Instant.now()); + Timestamp highestBan = ips.get(0).getTimestamp(); for(BannedUserIPs banned : ips) { if(highestBan.before(banned.getTimestamp())) highestBan = banned.getTimestamp(); @@ -70,8 +69,8 @@ public class BanListener extends BasicListener { for(BannedUserIPs banned : ips) { SteamwarUser bannedUser = SteamwarUser.get(banned.getUserID()); - potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getId(), - banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT), bannedUser.getUserName())); + potentialBan.append(Message.parse("BAN_AVOIDING_LIST", target, bannedUser.getUserName(), + banned.getTimestamp().toLocalDateTime().format(BungeeCore.DATE_FORMAT))); } TextComponent msg = new TextComponent(potentialBan.toString());