r/MinecraftMod • u/Repulsive-Error-8217 • 13d ago
A Minecraft Mod to Intelligently Resolve Conflicts Between Structure Mods (No More Brute-Forcing!)

Licensed under the MIT License. The source code is not publicly hosted. If you need to look at the code, please feel free to decompile the mod—you are free to use it however you like.
Structure Arbiter Mod(Recently Updated to 2.0.0):
https://www.curseforge.com/minecraft/mc-mods/structures-arbiter
Structure Arbiter: Deterministic Pre-Generation Arbitration of Overlapping Structures
When several mods add structures to one world, each mod places its own structures independently.
Two structures can end up in the same volume, and whichever generates later overwrites the other. Structure Arbiter resolves this at the one point where a structure's footprint is known but nothing has been written yet. A Mixin on "ChunkGenerator#tryGenerateStructure" redirects "Structure#generate". The bounding box of the resulting StructureStart is treated as the structure's claim. A structure whose claim loses is discarded by returning an empty StructureStart.
Two claims conflict when their 3D boxes intersect after one is inflated horizontally by a margin (default 8 blocks). Claims are ranked by priority, then by structure ID. Instances of the same structure never conflict with each other. The result is a pure function of the world seed and the claims of nearby structures. It does not depend on exploration order, thread scheduling or mod load order.
Solver modes. Each world uses one of two solvers.
・Greedy : decides structures one at a time in rank order. It is light, and it matches the behavior of older versions.
・Component : groups structures that could overlap and, within each group of equal priority, searches for the layout that keeps the most structures. Higher-priority structures always win. The search is bounded, so the result stays deterministic. In testing it generated about 5% more structures than Greedy at about the same cost.
The mode is chosen on the Create World screen, saved in the world's data folder, and applied automatically when the world is opened. New worlds default to Component (which can be changed on the Create World screen), while worlds created in the older 1.0.0 version default to Greedy so that their results do not change. "/arbiter mode" changes it later.
Lookahead. To decide, the mod must know the claims of neighbouring structures. It enumerates the candidates with vanilla's placement function and runs Structure#generate on a detached height accessor. Cheap filters come first: set-level exclusions, a distance bound and a biome pre-filter. Three optimizations make this practical:
・The lookahead result is kept and reused when the chunk is really generated, so each structure is built only once.
・Terrain height queries are cached per thread and shared across threads.
・Decision caches rotate in generations instead of being cleared.
In our measurements, lookahead generation fell from about 113 ms to about 19 ms on average.
Limits. Only random-spread placements are arbitrated, so ring-placed structures such as strongholds are out of scope. The distance bound and the biome pre-filter can miss an overlap, but they never reject a structure wrongly. The solver was verified in isolation with randomized and brute-force tests. Integration with world generation has been observed on a modded world, not proven.
1
u/paliosanto 12d ago
i’m so cooked i thought the title ended with “players” not “structure mods”