fix(chunks): wait for complete Bedrock data before sending - #422
Merged
Merged
Conversation
The independent lighting change allowed Java chunk packets to contain empty placeholders for Bedrock subchunks that had not arrived yet. Wait for every required section before queuing a send so the terrain loading screen cannot advance on partial chunk data. Remove the partial resend timer, which is no longer needed.
Subchunk requests were drained from a hash set in arbitrary order and all view-distance requests were sent in one tick. Request a bounded batch from the player outward, then send fully loaded chunks nearest first so distant replies cannot take the initial send budget ahead of nearby terrain.
Avoid sorting the entire outstanding request set on every chunk tracker tick. Keep a companion set for deduplication and rebuild the heap when the player chunk center changes so nearby requests remain first.
A fixed 256-request tick limit can delay otherwise ready columns across ticks. Send multiple bounded request packets while a short time budget remains, leaving the Java chunk send budget unchanged.
Restore the earlier request flow so a tick drains the queue in bounded packets. Keep the separate time budget for Java chunk conversion and sending.
Remove the per-packet 256-offset grouping so a tick issues one request containing every queued subchunk. Preserve distance ordering and the separate Java chunk send time budget.
Bound request preparation by elapsed time and share the tick deadline with Java chunk sends. Split requests at the Bedrock decoder limit of 8192 offsets per packet so large views do not disconnect the client.
Use smaller Bedrock request packets while retaining the elapsed-time limit for request work in each tick.
AlexProgrammerDE
marked this pull request as ready for review
September 23, 2026 18:38
Merge the current main branch and resolve the chunk tracker overlap with its new Checkstyle formatting. Keep complete subchunk readiness and nearby request ordering intact.
Exterminate5573
approved these changes
Sep 25, 2026
Exterminate5573
left a comment
Collaborator
There was a problem hiding this comment.
Looks fine to me
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 prior request path drained an unordered set and sent the entire view distance's subchunk requests in one tick. That allowed distant columns to finish and consume the Java chunk send budget before nearby terrain. The ordering change addresses the far-first sweep seen in the join video while keeping the full-chunk readiness rule.
Validation
./gradlew build(passes; this project has no test sources for the Gradle test task)git diff --check(passes)A live Bedrock server join is still needed to verify terrain appearance and loading-screen timing.