Reduce usable tile area

Fix DynamicRegionVisualizer throwing exceptions
This commit is contained in:
2026-03-21 22:52:10 +01:00
parent 81b582cdbb
commit 721d391e74
3 changed files with 29 additions and 12 deletions
@@ -88,6 +88,14 @@ public class DynamicRegionSystem implements RegionSystem {
.collect(Collectors.toUnmodifiableMap(entry -> entry.getValue().identifier(), Map.Entry::getKey));
DynamicRegionRepository.loadRegions();
// [STDOUT] PATH 239
// [STDOUT] DRY 4
// [STDOUT] DRY_SPECIAL 18
// [STDOUT] WET 2
// [STDOUT] WET_SPECIAL 9
regionTypeMap.forEach((type, regions) -> {
System.out.println(type + " " + regions.size());
});
new DynamicRegionCommand();
new WireframeCommand();
}
@@ -109,9 +117,10 @@ public class DynamicRegionSystem implements RegionSystem {
Set<Tile> tiles = new HashSet<>();
for (int x = minPoint.getX(); x < maxPoint.getX(); x += Tile.tileSize) {
for (int z = minPoint.getZ(); z < maxPoint.getZ(); z += Tile.tileSize) {
tiles.add(Tile.fromXZ(x, z).orElseThrow());
tiles.add(Tile.fromXZ(x, z).orElse(null));
}
}
tiles.remove(null);
return Collections.unmodifiableSet(tiles);
}