diff --git a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/punish/PlayerAltController.java b/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/punish/PlayerAltController.java index db41b21..37c1396 100644 --- a/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/punish/PlayerAltController.java +++ b/bukkit/src/main/java/io/wdsj/asw/bukkit/manage/punish/PlayerAltController.java @@ -48,12 +48,14 @@ public static boolean hasAlt(Player player) { */ public static Collection getAlts(Player player) { String ip = Utils.getPlayerIp(player); - if (!PLAYER_ALTS.containsKey(ip)) { - return Collections.emptyList(); + synchronized (PLAYER_ALTS) { + if (!PLAYER_ALTS.containsKey(ip)) { + return Collections.emptyList(); + } + return PLAYER_ALTS.get(ip).stream() + .filter(uuid -> !uuid.equals(player.getUniqueId())) + .collect(Collectors.toList()); } - return PLAYER_ALTS.get(ip).stream() - .filter(uuid -> !uuid.equals(player.getUniqueId())) - .collect(Collectors.toList()); } /**