Repository navigation
Conversation
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 #1603.
Problem
FragileBlockCallback.onHitis called from the contact callback whileRapier3D.stepis running, and it breaks the block right there. The neighbour updates fromdestroyBlockgo throughSubLevelPhysicsSystem.handleBlockChange→RapierPhysicsPipeline.handleBlockChange→RapierVoxelColliderBakery.getPhysicsDataForBlock. When the neighbouring block ends up in a state that has no collider yet (leaves changingdistance, vines losing a face, crops, …),Rapier3D.newVoxelCollideris called on the server thread while that same thread is still insidestep. The thread never comes back, and the server watchdog kills it after 60 s.We hit this on a NeoForge 21.1.248 dedicated server (Sable 2.0.6, Create Aeronautics) when ships hit trees. Every crash report had the same stack:
Change
Same idea as 6cd9a29 ("Queue rope wake-ups till after the physics tick"):
IN_PHYSICS_STEPis set,FragileBlockCallback.onHitqueues the break on the steppingSubLevelPhysicsSystemand returns the same result it does today (zero tangent motion, remove collision). Outside the step it still breaks the block straight away.SubLevelPhysicsSystembreaks the queued blocks right afterpipeline.physicsTickreturns, in the same substep and beforeprocessSubLevelRemovals, so sub-levels removed by the breaks are still handled in that substep as before.FragileBlockCallback.breakFragileBlock.Callbacks that override
onHit(bells, beehives, explosives, belts) still change the world during the step. This PR doesn't touch them.Testing
:common:compileJava,:neoforge:compileJava,:fabric:compileJava./sable assemble area, and dropped it about 15 blocks. The server hung and the watchdog crash showed the stack above.Can't keep up. That mixin has the same logic as this patch, but I haven't run this exact jar. A full build needs the Rust natives (Docker), which I didn't set up.