From 0e8b8315a2828d3fc6659562125becbd0100f587 Mon Sep 17 00:00:00 2001 From: Risto Lahtela <24460436+AuroraLS3@users.noreply.github.com> Date: Wed, 17 Mar 2021 11:31:57 +0200 Subject: [PATCH] Use last index of : instead of first to remove port --- .../plan/gathering/listeners/bukkit/PlayerOnlineListener.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java b/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java index d104ae1fc..10fe8267d 100644 --- a/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java +++ b/Plan/bukkit/src/main/java/com/djrapitops/plan/gathering/listeners/bukkit/PlayerOnlineListener.java @@ -117,7 +117,7 @@ public class PlayerOnlineListener implements Listener { boolean banned = result == PlayerLoginEvent.Result.KICK_BANNED; String joinAddress = event.getHostname(); if (!joinAddress.isEmpty()) { - joinAddresses.put(playerUUID, joinAddress.substring(0, joinAddress.indexOf(":"))); + joinAddresses.put(playerUUID, joinAddress.substring(0, joinAddress.lastIndexOf(':'))); } dbSystem.getDatabase().executeTransaction(new BanStatusTransaction(playerUUID, () -> banned)); dbSystem.getDatabase().executeTransaction(new OperatorStatusTransaction(playerUUID, operator));