Skip to content

Conversation

@filigreed
Copy link

Problem

Stock links weren't respecting priority. Simple case: create a logistics network with two inventories and a linked packager on each. Put a stack of the same material in each inventory. Place an order and observe which is used. Deprioritize that one with redstone/an analog lever. Place another order. Observe same packager being used despite being deprioritized.

Solution

Have groups of stock links under the same inventoryId tracked for priority along with other links via a list of lists. Flatten by choosing randomly between all links with the same + highest priority. I saw one user suggest picking the packager with the shortest queue, but I don't know enough about the code to figure out how to do that, so I kept what the previous contributor did.

Fixes #9689

I'm not the most experienced with Java, so any eyes and advice would be much appreciated. Thanks!

@VoidLeech VoidLeech added pr type: fix PR fixes a bug pr flag: simple PR has minimal changes labels Jan 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr flag: simple PR has minimal changes pr type: fix PR fixes a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Analog lever not working properly with stock link

2 participants