GregTechCEu / GregTech

GregTech CE 1.12 fork continuing progression and development
GNU Lesser General Public License v3.0
254 stars 176 forks source link

[WIP] initial change for fixing round robin voiding` #2601

Open jkieberking opened 2 months ago

jkieberking commented 2 months ago

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 a Object2IntMap<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...?

Still TODO (in addition to the above questions ^), want to finish these before this PR is fully "ready to go" (not a WIP)