Skip to content

Dynamic Trees

BonsUnleashed edited this page Oct 7, 2026 · 3 revisions

Dynamic Trees

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 Dynamic Trees 1.20.1-1.4.11 (mod id dynamictrees): thick trunk and trunk shell shapes are built once per size, and a fix stops rapid rot from looping until the stack overflows at the edge of a generation region. Background on Generation context fixes. 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
dynamictrees_rot_cycle_guard Dynamic Trees 1.20.1-1.4.11 BOTH 1.0.30 fix
dynamictrees_thick_shape_memo Dynamic Trees 1.20.1-1.4.11 BOTH 1.0.30 opt

dynamictrees_rot_cycle_guard

Since: 1.0.30 · Target: Dynamic Trees 1.20.1-1.4.11 · Side: BOTH (world generation; singleplayer runs it on the integrated server) · Kind: fix

Mixins: RotCycleBranchMixin, RotCycleRootsMixin, RotCycleOuterMixin, RotWriteBreakMixin, RotWriteFeatureMixin

Dynamic Trees: rapid rot no longer loops until the stack overflows at a generation region's edge. When a generated tree's branch is left without support, Dynamic Trees rots it away at once: the branch checks its neighbours, removes itself and checks them again, one inside the other. During world generation a feature may only write one chunk out from the chunk being decorated. A branch beyond that edge cannot be removed: the removal is refused, Dynamic Trees still counts it as rotted, and two such branches next to each other check each other forever, until the thread's stack overflows (Dynamic Trees issue 1150, still reachable in 1.4.11: the chunk's generation dies with a StackOverflowError and takes the server down). A check that comes back to the same branch with the same radius while no rot write has succeeded since the last visit can only repeat itself, so that repeat now stops and the branch stays (where the original crashed). Every cascade that ends in the original is left exactly as it is. Species, features or blocks that replace Dynamic Trees' own rot code, and fertile branch cascades, always run the original.

Measured: offline on Dynamic Trees' own classes, issue 1150's layout overflowed the stack in the original (on a real generation region too) and ended after one stop with the switch. In 6,000 random worlds (49 million traced steps), the 5,568 that end in the original were identical with the switch (blocks, results, random state) and the 432 that overflowed ended, identical up to the first stop.


dynamictrees_thick_shape_memo

Since: 1.0.30 · Target: Dynamic Trees 1.20.1-1.4.11 · Side: BOTH · Kind: opt

Mixins: ThickShapeMixin, TrunkShellShapeMixin

Dynamic Trees: thick trunk and trunk shell shapes are built once per size. Thick trunks (radius 9 to 24) and the shell blocks around them built a new shape from a box on every shape query (collisions, block outlines, pathfinding). There are only 16 thick sizes and a shell sits at one of a few offsets around its trunk, so those shapes are now built once and handed back again. A box that is not exactly one of those sizes and offsets is built as before. Shapes cannot be changed after they are built, so a shared one answers the same.

Measured: offline on Dynamic Trees' own blocks, every radius, waterlogged or not, 40 neighbour layouts and every shell position gave the same geometry as the original (405,508 checks). A thick trunk query took 38 instead of 54 ns and 64 instead of 264 bytes, a shell query 174 instead of 222 ns and 288 instead of 688 bytes.

Bons and Furious

Minecraft 1.20.1 / Forge 1.0.34

Compatibility

Controls by mod

Links

Clone this wiki locally