[WIP] initial change for fixing round robin voiding` #2601
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.
What
This PR is meant to fix the voiding bug seen in #2548 where conveyors with the
round robin with priority
IO mode voids items.Implementation Details
The root cause of the bug is explained here, which is essentially that we don't keep track of how much space is left in a machine/inventory when we do a dry run, so sequential dry runs think that they can insert more than they actually can (which results in us extracting/voiding the excess amount.)
Outcome
The initial version of this MR opts to keep track of what we are inserting during a dry run via a
simulatedRemainingCapacityRoundRobin
, which is aObject2IntMap<FacingPos>
. I also updated some variable names to better show what they do.This initial implementation does not fully work - I was hoping to push it and get some feedback/assistance as I'm new to the repo/modding GT in general, so am not sure about certain standards/etc...
The main question I have is: What is the best way to get the free input inventory space in a machine/block/chest/etc...?
- currently I am doing this via:
```
int freeInventoryInSubRoute = 0;
int slots = routePath.getHandler().getSlots();