Repository navigation
[1.20.1] Skip routing checks for empty cable buffers - #2546
Open
yaroslav4167 wants to merge 1 commit into
Open
yaroslav4167 wants to merge 1 commit into
yaroslav4167 wants to merge 1 commit into
Conversation
yaroslav4167
marked this pull request as ready for review
November 12, 2026 09:56
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.
Empty item/fluid cable buffers currently enter the outgoing-direction loop before discovering that there is nothing to transfer. Item cables can perform up to 36 connection checks per empty
normalFlow()call; fluid cables perform 30, including block-state property lookups and randomized direction-list creation.Add an early null/empty-buffer guard before that loop in both cable implementations on
trunk/1.20.1. Extraction still runs first, so resources extracted during the current tick can flow immediately. Keep the existing fluid check inside the outgoing loop because a buffer can become empty during that loop. Transfer quantities, filters, routing predicates, dead-end fallback and saved data are unchanged. Skipping the shuffle for empty buffers changes random-number consumption, so identical future random routing sequences are not promised.Validation:
git diff --checkpasses.normalFlow()source methods passed 98,304 cases: all 64 occupied-buffer masks, all 64 blocked-side masks, six direction orders, two resource amounts and both cable types. Final resources and transfer traces matched; surrounding handlers/world were modeled.Invalid patcher dependency, could not resolve sources: null. Full Forge compilation/integration is therefore unverified.