From 248e0c17ad207de74b9e68c6b78c4d4f244bb517 Mon Sep 17 00:00:00 2001 From: holmraven <16858119+holmraven@users.noreply.github.com> Date: Fri, 13 Jan 2023 17:07:20 +0200 Subject: [PATCH] Fix concurrent exception --- .../lifecycle/MapAtlasesServerLifecycleEvents.java | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/main/java/pepjebs/mapatlases/lifecycle/MapAtlasesServerLifecycleEvents.java b/src/main/java/pepjebs/mapatlases/lifecycle/MapAtlasesServerLifecycleEvents.java index 1d403aa..0b68572 100644 --- a/src/main/java/pepjebs/mapatlases/lifecycle/MapAtlasesServerLifecycleEvents.java +++ b/src/main/java/pepjebs/mapatlases/lifecycle/MapAtlasesServerLifecycleEvents.java @@ -147,12 +147,7 @@ public static void mapAtlasServerTick(MinecraftServer server) { // Clean up disconnected players in server tick // since when using Disconnect event, the tick will sometimes // re-add the Player after they disconnect - // TODO: Fix concurrent exception here? - for (String playerName : playerToActiveMapId.keySet()) { - if (!seenPlayers.contains(playerName)) { - playerToActiveMapId.remove(playerName); - } - } + playerToActiveMapId.keySet().removeIf(playerName -> !seenPlayers.contains(playerName)); } private static void updateMapDataForPlayer(