Repository navigation
Stop splitting once the sub-level has been removed - #1627
Open
anenigmabeyondwords wants to merge 1 commit into
Open
anenigmabeyondwords wants to merge 1 commit into
anenigmabeyondwords wants to merge 1 commit into
Conversation
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).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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,SubLevelPhysicsSystemdestroys them and marks the parent removed, inside the loop. The next iteration'sassembleBlocksthen throwsSub-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:
Body has been removedwhile saving on shutdown.This branch (on
mainat d501fb3) compiles (:common:compileJava); I did not run the game tests. Happy to add a game test for the case if you want one.