Skip to content

TerraBlender

BonsUnleashed edited this page Oct 7, 2026 · 4 revisions

TerraBlender

Minecraft 1.20.1 / Forge: this page documents that build and its measurements. For the separate 170-control Minecraft 1.21.1 port, see Minecraft 1.21.1 NeoForge.

Two controls for TerraBlender 3.0.1.10 (mod id terrablender), both world-generation controls: the surface rule is picked once per biome, and only the surface rules a chunk uses are built. Every switch checks the code it would change against the tested build; another build is left untouched with one WARN line (see How the patches are applied).

Key Target Side Since Kind
terrablender_lazy_namespace_rules TerraBlender 3.0.1.10 SERVER 1.0.28 opt
terrablender_namespace_rule_memo TerraBlender 3.0.1.10 SERVER 1.0.28 opt

terrablender_namespace_rule_memo

Since: 1.0.28 · Target: TerraBlender 3.0.1.10 · Side: SERVER · Kind: opt

Mixin: NamespacedRuleMemoMixin

TerraBlender surface rule picked once per biome. TerraBlender's surface rule runs for every stone block a chunk's surface pass visits (about 150,000 per 768-high chunk) and each time works out the biome's namespace again: a lambda, two string lookups and an Optional. Its map is fixed for the rule's lifetime and a biome's key never changes, so the rule now keeps the last biome object and the namespace rule picked for it, and picks again only when the biome object changes.

Measured: 38.9 -> 13.4 ns per stone block on real classes (5.8 -> 2.0 ms per 768-high chunk); 2,783,033 checks identical.

Since 1.0.34. The values this control keeps on a record class are skipped by Gson. Up to 1.0.33 a mod that saves such a record with Gson failed with a NoSuchMethodException, because Gson asks a record for an accessor for every field it holds (reported with Dragon Mounts Remastered on Minecraft 1.21.1; no case is confirmed on Forge 1.20.1). Nothing else changes.


terrablender_lazy_namespace_rules

Since: 1.0.28 · Target: TerraBlender 3.0.1.10 · Side: SERVER · Kind: opt

Mixin: NamespacedSourceDeferMixin

TerraBlender builds only the surface rules a chunk uses. For every chunk's surface pass TerraBlender builds the full surface rule tree of every namespace it knows (Minecraft plus every mod that registered surface rules), hundreds of objects each, although a chunk normally reaches one or two of them (review-8 profile: 4.5-25% of all world generation worker allocation sits there). A namespace made only of vanilla rule sources is now built at its first use in the chunk, with the very same call; one that contains any other mod's rule source is built up front as before.

Measured: 16,478,967 in-game per-block comparisons with every namespace built up front, all identical (shadow mode, dedicated server without C2ME, 516 new chunks); not benchmarked on its own (review-8 profile: 4.5-25% of all world generation worker allocation sat in this method). With C2ME installed it stands down by itself: C2ME changes a vanilla rule source this switch relies on.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally