Fix cross-dimension entity travel under parallel world ticking with post-tick handoff#666
Open
splatage wants to merge 1 commit intoWinds-Studio:ver/1.21.11from
Open
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.
Summary
The PR succeeds the previously submitted one and should be considered in the place of
This PR fixes cross-dimension entity portal travel when parallel world ticking (PWT) is enabled.
The core issue was that entities could begin portal travel while ticking on one world thread, then immediately read or mutate destination-world state from the wrong thread. That caused hard thread-check failures and made cross-dimension travel unsafe under PWT.
This patch changes that flow so cross-dimension transfers are queued during world tick and then drained after all world tick tasks join, on the safe server-thread handoff phase. This keeps destination-world mutation out of source-world tick threads and preserves normal same-dimension behaviour.
Problem
Under PWT, portal handling could attempt cross-world work inline during entity ticking. That caused problems such as:
This was reproducible with entities entering Nether portals while PWT was enabled.
What this PR changes
Entity portal handling
Server-side transfer handoff
Transfer validation / safety
Before applying a queued transfer, the drain phase verifies that:
isAllowedToEnterPortal(...) / canTeleport(...)checks still passPassenger handling
The latest patch in this PR also fixes entities with passengers so they no longer disappear during portal travel. Passenger-bearing travel now behaves correctly through the queued cross-dimension handoff path.
Scope
This PR is intentionally limited to:
It does not attempt to broadly solve every cross-world command or side-effect case under PWT. That remains separate work.