Skip to content

Stop splitting once the sub-level has been removed - #1627

Open
anenigmabeyondwords wants to merge 1 commit into
ryanhcode:mainfrom
anenigmabeyondwords:fix/split-stops-when-removed
Open

anenigmabeyondwords wants to merge 1 commit into
ryanhcode:mainfrom
anenigmabeyondwords:fix/split-stops-when-removed

Conversation

@anenigmabeyondwords

@anenigmabeyondwords anenigmabeyondwords commented Oct 13, 2026 •

Copy link
Copy Markdown

Fixes #1376 (and the same crash in #1344).

SubLevelHeatMapManager.split() assembles the cut-off pieces one after another. Moving a piece's blocks out is a block change on the parent; if the blocks left in the parent have no mass, SubLevelPhysicsSystem destroys them and marks the parent removed, inside the loop. The next iteration's assembleBlocks then throws Sub-level assembly attempted inside plot of already removed sub-level. The loop now stops once the parent is removed: its remaining blocks were destroyed with it, so there is nothing left to assemble.

Reproduction (commands in this comment): a sub-level of light blocks with one stone arm ending in a stone piece and one ending in a light piece, both arms cut by a single /fill, so the stone piece is assembled first.

Testing. We run the same change as a bytecode patch on 2.0.6 (NeoForge 21.1.248, dedicated server, 120 mods), on throwaway servers with the commands above:

  • 2.0.6: crash (twice), followed by Body has been removed while saving on shutdown.
  • 2.0.6 + this change: no exception, the stone piece ends up as its own sub-level, 20 TPS.
  • A three-block bar cut in the middle still splits into two sub-levels on both.

This branch (on main at d501fb3) compiles (:common:compileJava); I did not run the game tests. Happy to add a game test for the case if you want one.

Assembling one split piece can leave the parent sub-level without mass, which destroys its
remaining blocks and marks it removed inside the split loop. The next piece's assembly then
throws "Sub-level assembly attempted inside plot of already removed sub-level" (ryanhcode#1376, ryanhcode#1344).
@CLAassistant

CLAassistant commented Oct 13, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

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.

java.lang.RuntimeException: Sub-level assembly attempted inside plot of already removed sub-level

2 participants