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) {
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, List<Character>> current = Maps.newHashMap();
Set<Character> 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() {