From 8c44c024abd82647977193a6934d1220ed2347c0 Mon Sep 17 00:00:00 2001 From: Sen Date: Sat, 21 Jun 2025 20:17:36 +0200 Subject: [PATCH] fix server block id loading --- server/src/main/java/server/world/Region.java | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/server/src/main/java/server/world/Region.java b/server/src/main/java/server/world/Region.java index 79b65a38..6f33ace8 100755 --- a/server/src/main/java/server/world/Region.java +++ b/server/src/main/java/server/world/Region.java @@ -74,6 +74,11 @@ public class Region { } private static boolean makeMap(TagObject tag) { + Set removed = Sets.newHashSet(); + for(String id : tag.keySet()) { + if(tag.hasChar(id)) + removed.add(id); + } Map mapping = Maps.newHashMap(); Map> current = Maps.newHashMap(); Set taken = Sets.newHashSet(); @@ -102,7 +107,7 @@ public class Region { } mapping.put(id, bid); taken.add(bid); - tag.remove(id); + removed.remove(id); Log.IO.debug("Bestehende Block-ID %d = %s", (int)bid, id); } else { @@ -129,11 +134,11 @@ public class Region { ENCODE_MAP[id] = bid; } } - for(String id : tag.keySet()) { - if(tag.hasChar(id)) - Log.IO.debug("Entfernte Block-ID %d = %s", (int)tag.getChar(id), id); + for(String id : removed) { + tag.remove(id); + Log.IO.debug("Entfernte Block-ID %d = %s", (int)tag.getChar(id), id); } - return !missing.isEmpty() || !tag.isEmpty(); + return !missing.isEmpty() || !removed.isEmpty(); } public static void loadMap() {