fix server block id loading

This commit is contained in:
Sen 2025-06-21 20:17:36 +02:00
parent 1b041cbf56
commit 8c44c024ab
Signed by: sen
GPG key ID: 3AC50A6F47D1B722

View file

@ -74,6 +74,11 @@ public class Region {
} }
private static boolean makeMap(TagObject tag) { private static boolean makeMap(TagObject tag) {
Set<String> removed = Sets.newHashSet();
for(String id : tag.keySet()) {
if(tag.hasChar(id))
removed.add(id);
}
Map<String, Character> mapping = Maps.newHashMap(); Map<String, Character> mapping = Maps.newHashMap();
Map<String, List<Character>> current = Maps.newHashMap(); Map<String, List<Character>> current = Maps.newHashMap();
Set<Character> taken = Sets.newHashSet(); Set<Character> taken = Sets.newHashSet();
@ -102,7 +107,7 @@ public class Region {
} }
mapping.put(id, bid); mapping.put(id, bid);
taken.add(bid); taken.add(bid);
tag.remove(id); removed.remove(id);
Log.IO.debug("Bestehende Block-ID %d = %s", (int)bid, id); Log.IO.debug("Bestehende Block-ID %d = %s", (int)bid, id);
} }
else { else {
@ -129,11 +134,11 @@ public class Region {
ENCODE_MAP[id] = bid; ENCODE_MAP[id] = bid;
} }
} }
for(String id : tag.keySet()) { for(String id : removed) {
if(tag.hasChar(id)) tag.remove(id);
Log.IO.debug("Entfernte Block-ID %d = %s", (int)tag.getChar(id), 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() { public static void loadMap() {