diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/StoredRecords.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/StoredRecords.java index ef0a449b..16601bdf 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/StoredRecords.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/StoredRecords.java @@ -53,6 +53,12 @@ public class StoredRecords { }, 1, 1); } + static void cleanup(Player player) { + isolatedTNT.forEach((region, playerListMap) -> playerListMap.remove(player)); + replayTime.forEach((region, playerIntegerMap) -> playerIntegerMap.remove(player)); + replayLoops.forEach((region, playerIntegerMap) -> playerIntegerMap.remove(player)); + } + public static void add(Region region, Record record) { records.computeIfAbsent(region, k -> new ArrayList<>()).add(record); } diff --git a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java index d04ee169..565db661 100644 --- a/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java +++ b/BauSystem_Main/src/de/steamwar/bausystem/features/tracer/show/TraceShowManager.java @@ -161,13 +161,12 @@ public class TraceShowManager implements Listener { @EventHandler public void onLeave(PlayerQuitEvent event) { Region region = Region.getRegion(event.getPlayer().getLocation()); - if (region.isGlobal()) { - return; + if (!region.isGlobal()) { + Map> regionalShowModes = showModes.get(region); + if (regionalShowModes != null) { + regionalShowModes.remove(event.getPlayer()); + } } - Map> regionalShowModes = showModes.get(region); - if (regionalShowModes == null) { - return; - } - regionalShowModes.remove(event.getPlayer()); + StoredRecords.cleanup(event.getPlayer()); } }