Modrinth · Fabric, Forge, NeoForge

Structure Layout Optimizer auf deinem Minecraft Server

Structure Layout Optimizer läuft auf Minecraft Servern mit Fabric oder Forge oder NeoForge. Bestell deinen Server, stell den Loader im Panel ein und installiere die Mod mit einem Klick im Mod-Browser.

Attempts to optimize the generation of Jigsaw Structures and NBT pieces

Downloads
8.8M
Autor
TelepathicGrunt
Loader
Fabric, Forge, NeoForge
Minecraft
1.16.1 – 26.3
Aktualisiert
–

Einrichtung

Structure Layout Optimizer auf dem Server installieren

Server und Spieler brauchen denselben Loader und dieselbe Minecraft-Version. Sichere die Welt, bevor du Mods hinzufügst oder aktualisierst.

  1. 01

    Konfigurieren

    4 GB RAM sind vorausgewählt. Laufzeit und Add-ons wählst du selbst, bezahlt wird per Kreditkarte oder PayPal.

  2. 02

    Loader einstellen

    Stell im Panel die Serversoftware auf Fabric oder Forge oder NeoForge und wähl die passende Minecraft-Version, zum Beispiel 26.3.

  3. 03

    Mod installieren

    Such im Mod-Browser nach „Structure Layout Optimizer“ und installiere die Version für deinen Loader. Alternativ lädst du die .jar per SFTP in den Ordner mods. Erforderliche Abhängigkeiten stehen auf der Projektseite.

  4. 04

    Verbinden

    Structure Layout Optimizer ist auf dem Client nicht nötig. Spieler verbinden sich über die Serveradresse aus dem Panel.

Auf dem Server
Erforderlich
Auf dem Client
Nicht nötig
Loader
Fabric, Forge, NeoForge
Minecraft
26.3, 26.2, 26.1.2 +17 weitere
Lizenz
MIT License

Das Panel

Mods installieren, Fehler finden.

Echte Screenshots aus dem Mado Panel. Beides ist bei jedem Minecraft Server enthalten.

Mod-Browser

Modrinth und CurseForge direkt im Panel.

Der Browser filtert nach deiner Minecraft-Version. Mods installierst du mit einem Klick, ohne .jar-Dateien hochzuladen.

Browser im Mado Panel mit Suche, Quellenwahl CurseForge oder Modrinth und Install-Buttons.

KI-Crash-Analyse

Wenn ein Mod crasht, liest die Analyse das Log.

Mods scheitern oft an einer falschen Loader-Version, Java-Version oder fehlenden Abhängigkeit. Die Analyse nennt eine wahrscheinliche Ursache und einen Lösungsvorschlag.

Optimierungsseite im Mado Panel mit aktiviertem KI-Log-Analyzer und der Meldung „Server Crashed“ samt Button „Analyze Now“.

Versionen

Veröffentlichte Versionen

Nimm die Datei, die zu Loader und Minecraft-Version deines Servers passt. Server und Spieler brauchen dieselbe Version.

Structure Layout Optimizer · Modrinth
Originalbeschreibung des Projektautors

Optimizes general Jigsaw structure generation as best I can. Essentially this mod aims to not change how structures look at all. It only works to try and make structures generate faster and more efficiently. That's it.

Here are the more technical details of the optimizations done. Please report any conflicts or issues that is discovered when running this mod in your modpacks!

  • Replaces VertexShape unoptimized calls with a BoxOctree to make pieces only check nearby pieces for intersections instead of entire structure.

    • By default, vanilla uses a VoxelShape to store the bounds of pieces it is assembling for the structure layout. When it goes to add a new piece, it needs to see if it will fit into the layout without intersection any other pieces.

      The issue is VoxelShape is not good for this purpose as when checking if a VoxelShape intersects another VoxelShape, ALL the vertices are compared. In Jigsaw structures with lots and lots of pieces, this intersection check slows down greatly the more valid pieces are added to the layout. Can cause a lag spike when generating high number of pieces for recursive Jigsaw structures.

      The optimization here replaces the normal VoxelShape with a dummy VoxelShape that holds a BoxOctree implementation inside in order to pass around the BoxOctree to where it needs to be. This BoxOctree, when checking for intersections, will check only the nearby pieces to the incoming bounding box. Thus preventing the runaway growth in intersection checking time as it'll ignore the majority of pieces as they are too far away to matter for the check.

  • Check if a Jigsaw Block is blocked off entirely to know when to skip checking child rigid pieces.

    • In vanilla, every single Jigsaw Block in the parent piece will check every single Jigsaw Block in a child piece to know when to attempt to connect the two pieces. The issue is if the parent piece's Jigsaw Block is facing the edge of the structure boundary OR is facing another separate piece, then that Jigsaw Block has no room to ever spawn a rigid structure piece. Therefore, we can tell the game to skip checking this rigid child piece and check the next piece instead. This saves us from doing lots of expensive Jigsaw Block match up checks. Especially in structures that have a huge number of Jigsaw Blocks.

  • (26.2 and below) Replaces Jigsaw target/facing match up with a slightly more optimized version.

    • Reduces the number of block properties grabbing by half. Vanilla calls getValue twice for each JigsawBlock to get top and front values from the same property when it could just grab it once and get all values it needs. Slightly improved the speed of getting the joints, targets, and name string values from the Jigsaw Blocks's NBT as well.

      Also simplify joint data checking to not need to be converted to an Enum with byName (not performant) and reordering checks to reduce amount of logic that needs to run often.

      This will help with Jigsaw structures that have a very high amount of Jigsaw Blocks in them as each Jigsaw Block runs through this matching code for all Jigsaw Blocks in the other structure pieces.

  • Made any giant structure NBT that has no finalizeProcessing StructureProcessor now load much faster.

    • When a NBT structure piece goes to generate in a chunk, the ENTIRE NBT piece is loaded into memory, and then iterated over all the positions multiple times for StructureProcessors to apply and then later ignores all the positions outside the currently generating chunk. This is not very efficient (really wasteful) and causes large load times for giant NBT files.

      This mod's optimization works by doing the bounds check early to strip out all positions that we don't need before passing it to the StructureProcessors. However, any StructureProcessor that overrides finalizeProcessing method could require all the NBT positions to function correctly so this optimization is disabled for any pieces with these kinds of StructureProcessors which will be very few structures. In vanilla, only Trail Ruins will not get this optimization due to its use of the Capped StructureProcessor that overrides finalizeProcessing method.

  • (1.21.1+) Replaced the Jigsaw Block list shuffling and prioritization logic in SinglePoolElement with a slightly faster version.

    • Main benefit is slightly faster selection_priority data grabbing from NBT by using a new method that grabs the entry once instead of twice. Vanilla does it twice to check the data type first before returning the value. A bit odd and wasteful.

      Also tried a new sorting system for the prioritization, but only helps the few structures that actually makes use of selection_priority like Trials Chamber. Overall, this is probably the weakest optimization but it does quite a bit of help for Jigsaw structures that has an absolutely ridiculous amount of Jigsaw Blocks. So it is worth keeping this optimization.

      Might break parity with vanilla seeds in regard to what order the Jigsaw Block are ran in, but I could not find evidence of this yet.

  • Skip running logic for SinglePoolElements we already checked and could not spawn at the current spot.

    • So this optimization comes from the fact that vanilla StructureTemplatePool holds a list of all the SinglePoolElements with duplicates of the elements based on their weight value. So if in a Template Pool, you specify weight 100 for a house, that house will be put into this list 100 times! And when generating the layout, the game will make a copy of this list, shuffle it, and iterate over the list to try and spawn the first piece it finds that fits. This means it will rerun the checking logic for duplicate entries in this list even if it was found to not fit before at the spot. The optimization I do is skip the logic for pieces we already checked before and continue to the next piece in the list. This gives a nice performance boost for structures that uses a lot of high weight values in their Template Pools.

    • Furthermore, you can turn on the deduplicateShuffledTemplatePoolElementList config option to get even more performance out of high weight elements in Template Pools. The issue is this config comes at a cost of changing the layout of the structure. The layout is still valid and good. It would just be different than if the config option is kept off. Basically it breaks seed parity for structure layouts specifically to get that extra performance boost.

    • *To be clear, seed parity is every time you use the seed 777 and there is a village at a spot with 2 blacksmith houses, every time you use that same seed, that village will remain at that spot with the two blacksmith houses. With this optimization config turned on and same seed, that village will still be at same spot. But it may have 1 blacksmith house this time. And every time you use the same seed with this config on, the village will continue to generate with the 1 blacksmith house. The layout is seed stable. But just no longer is the same as if the config is turned off.


  • (1.21.4 with v1.1.0+): Swap StructureTemplate$Palette's list of StructureBlockInfo objects to be a palette of StructureBlockInfo objects instead for reduced memory usage when not generating that cached StructureTemplate.

    • This optimization is a modified form from contaria's Glacier mod for 1.16.1. Special thanks to them for allowing me to use their code as a basis for this optimization!

    • Essentially in vanilla, every time a structure nbt file is loaded, it is converted to a StructureTemplate object and cached. Buried in that object is a list of ALL the positions from that nbt file paired with the blocks and nbt tag at each position. This is the biggest memory hog for StructureTemplate objects. What this mod will do is swap this list with a special palette data structure object under the hood that pretends to be a list. The memory size of the palette is significantly smaller than the list! Then when queried for worldgen, it will construct the list again as a WeakReference so worldgen remains fast and works properly. And when worldgen is done, this list will get garbage collected to free up memory again, allowing each StructureTemplate to only use the full amount of memory they need when doing worldgen but stay cached in a smaller form long term. The downside is this list cannot and should not be modified with add, remove, clear calls and will throw and exception if done. Luckily, I do not think any mod is modifying this list itself on StructureTemplate directly but if they do, please let me know.

    • ModernFix does have a mixin that will make the StructureTemplate objects themselves be a SoftReference and be removed completely from memory when the game gets full on memory. This is a valid solution and aims to stop the memory leak of loading structure nbts into a cache that never clears in long term gameplay. The downside of this is that the piece has to be loaded directly from the file again if it was cleared from memory. This mixin will work just fine alongside my mod's optimization. What will probably happen is my mod make StructureTemplate smaller in memory which allows ModernFix to keep more StructureTemplates in memory without them getting fully removed from memory. Which should allow more cache hits over long term. In theory.


FAQ

Fragen zu Structure Layout Optimizer

Deine Frage fehlt? Frag unser Team.

Structure Layout Optimizer Server crasht beim Start – was tun?

Häufige Ursachen: Loader- oder Minecraft-Version passen nicht zur Mod-Datei, eine Abhängigkeit fehlt oder der RAM reicht nicht. Such im Log (latest.log) nach „OutOfMemoryError“, „Mixin“ oder fehlenden Mods. Bei Mado wertet die KI-Crash-Analyse das Log aus und schlägt eine Ursache vor. Loader und Version änderst du im Panel.

Mit welchem Loader läuft Structure Layout Optimizer?

Laut Modrinth unterstützt Structure Layout Optimizer Fabric, Forge, NeoForge für Minecraft 26.3, 26.2, 26.1.2. Forge- und Fabric-Dateien sind nicht untereinander austauschbar: Wähl einen Loader für Server und Clients.

Wie viel RAM braucht ein Server mit Structure Layout Optimizer?

Als Orientierung 3–4 GB für einen Server mit dieser Mod. Das ist eine Schätzung, keine gemessene Mindestanforderung. Weitere Mods, viele Spieler und große Sichtweiten brauchen mehr. Ob eine Mod die Tick-Zeit belastet, siehst du mit dem spark-Profiler.

Bereit für deinen Server mit Structure Layout Optimizer?

4 GB RAM ab 8,00 € im Monat. 35 % auf den 1. Monat mit MADO35.

Server bestellen