Use last index of : instead of first to remove port

This commit is contained in:
Risto Lahtela 2021-03-17 11:31:57 +02:00
parent 2bc15db6d0
commit 0e8b8315a2

View File

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