Skip to content

Stop rapid rot cycles when world generation refuses every write - #1230

Open
BonsUnleashed wants to merge 1 commit into
DynamicTreesTeam:release/1.20.1from
BonsUnleashed:bons-furious/dynamictrees-rot-cycle-guard
Open

BonsUnleashed wants to merge 1 commit into
DynamicTreesTeam:release/1.20.1from
BonsUnleashed:bons-furious/dynamictrees-rot-cycle-guard

Conversation

@BonsUnleashed

Copy link
Copy Markdown

During world generation, a region can refuse a branch removal while continuing to return that branch from reads. Species.rot still reports success, so rapid rot can recurse between neighbouring branches until the stack overflows.

This tracks active rot checks and successful branch removals and post-rot placements. It stops a repeated check only when no rot write has succeeded since the earlier check. Cascades that make progress can revisit positions. Both branch and root methods use finally cleanup, including when a recursive call throws.

The guard is limited to the exact WorldGenRegion implementation. Other level accessors and custom branch, species or feature code keep the original path. This follows the refused-write guard prepared for Bons and Furious 1.0.30.

compileJava passed against the current release/1.20.1 branch on Java 17.

Checks using the actual guard and extracted native call bodies passed refused writes, successful revisits, partially writable regions, custom/fertility fallbacks, exception cleanup and subsequent direct calls. Minecraft dependencies were stubbed. The failure is related to #1150; I have not tested this build in the reporter's world.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant