From b3b13d2950aadfb801a337bccbdc0b52c876c7e2 Mon Sep 17 00:00:00 2001 From: Chaoscaot Date: Thu, 13 Nov 2025 23:01:37 +0100 Subject: [PATCH] Move `Chatter.disconnect` call to ensure proper execution after IP ban check. Signed-off-by: Chaoscaot --- .../de/steamwar/velocitycore/commands/PunishmentCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VelocityCore/src/de/steamwar/velocitycore/commands/PunishmentCommand.java b/VelocityCore/src/de/steamwar/velocitycore/commands/PunishmentCommand.java index 8305b104..ec5015a3 100644 --- a/VelocityCore/src/de/steamwar/velocitycore/commands/PunishmentCommand.java +++ b/VelocityCore/src/de/steamwar/velocitycore/commands/PunishmentCommand.java @@ -90,13 +90,13 @@ public class PunishmentCommand { Player player = VelocityCore.getProxy().getPlayer(user.getUUID()).orElse(null); if (player != null) { String ip = IPSanitizer.getTrueAddress(player).getHostAddress(); - Chatter.disconnect(player).system(punishmentMessage(user, Punishment.PunishmentType.Ban)); for (BannedUserIPs banned : BannedUserIPs.get(ip)) { SteamwarUser bannedUser = SteamwarUser.byId(banned.getUserID()); if (bannedUser.isPunished(Punishment.PunishmentType.Ban) && bannedUser.getPunishment(Punishment.PunishmentType.Ban).getEndTime().before(time)) { bannedUser.punish(Punishment.PunishmentType.Ban, time, banReason, punisher.getId(), perma); } } + Chatter.disconnect(player).system(punishmentMessage(user, Punishment.PunishmentType.Ban)); if (!player.getUsername().startsWith(".")) { BannedUserIPs.banIP(user.getId(), ip); }