Structure Layout Optimizer
A modification that significantly speeds up the generation of Jigsaw structures in Minecraft while preserving their original appearance and functionality. All optimizations are aimed exclusively at improving performance without changing gameplay.
Main Optimizations
Accelerated Intersection Checking
In the standard version of the game, an inefficient VoxelShape is used to check intersections between structure elements, which compares all vertices of all elements. This leads to significant slowdowns when generating complex structures with many elements.
The mod replaces this system with BoxOctree - a special data structure that checks only neighboring elements, ignoring those that are too far away. This prevents exponential growth in checking time as the number of elements in the structure increases.
Intelligent Jigsaw Block Checking
The system now determines when a Jigsaw block is completely blocked and cannot create a child element. In such cases, the check is skipped, saving significant computational resources, especially in structures with huge numbers of Jigsaw blocks.
Optimized Jigsaw Block Matching
Improved the algorithm for matching Jigsaw blocks with each other. The number of accesses to block properties is halved, data retrieval from NBT is accelerated, and connection checking is simplified. This is especially noticeable in structures with many Jigsaw blocks.
Fast Loading of Large NBT Structures
For large NBT structure files, early boundary checking has been added that cuts out unnecessary positions before passing to StructureProcessors. This significantly speeds up the loading of large structures, except for those that use special processors with the finalizeProcessing method.
Improved Priority Logic (1.21.1+)
In versions 1.21.1 and above, the Jigsaw block selection priority system has been optimized. Priority data retrieval from NBT is accelerated and the sorting system is improved, which is especially useful for structures like Trials Chamber.
Elimination of Duplicate Checks
The system now remembers which elements have already been checked and didn't fit the current position, eliminating repeated checks. This is especially effective for structures with high weight values in Template Pools.
Additionally, the deduplicateShuffledTemplatePoolElementList option is available for even greater performance, but it may change the appearance of structures while maintaining seed stability.
Memory Usage Optimization (1.21.4+)
In versions 1.21.4 and above, a palette system for StructureTemplate objects has been implemented, which significantly reduces memory consumption when caching structures. The full block list is created only during world generation and then freed from memory.
This optimization is compatible with other optimization mods, such as ModernFix, and can work together with them for maximum efficiency.
Compatibility
The mod is compatible with most other modifications and does not conflict with them. All optimizations preserve the functionality of the original game, only speeding up generation processes.