Miscounted blocks for intersecting subregions (may be intended behaviour)
2001herne opened this issue ยท 1 comments
When a schematic includes intersecting/overlapping subregions the blocks that appear in multiple subregions are counted multiple times on the materials list, resulting in apparently increased build requirements.
MC version: 1.19.2
MaLaLib version: 0.13.0 (malilib-fabric-1.19.2-0.13.0.jar)
Litematica version: 0.12.4 (litematica-fabric-1.19.2-0.12.4.jar)
I would classify this as "not exactly intended but just works like it due to the implementation".
Basically overlapping sub-regions (and similarly also overlapped loaded placements) are just problematic. The mod handles each sub-region individually, by just iterating through its volume. So it doesn't know if any already handled or later region would overlap with it.
It would sort of become an expensive check if every sub-region would need to check against every other sub-region (and in many cases not only in the same schematic, but every loaded and enabled placement!) to check if there are any overlaps. And even then it would then become a question of what should happen with the overlapping regions then? And there are even two different cases for that: overlaps where the blocks between the regions match/align, and when the regions would contain different blocks for some or all positions. And the behavior may need to be different for different places in the code: for building the schematic world, for counting items for a material list, for checking the world against the schematic in the verifier.
So basically in general I would recommend just not overlapping sub-regions, if possible, due to all the problems it will cause. Sometimes it requires creating more small regions to cover everything near intersections of larger sub-regions.
I can't say for sure yet if I'll ever try to solve this by subtracting the intersecting parts between regions, but like I explained above that leads to all kinds of questions about how things should behave exactly in various different situations.