Stocking hatch & bus disabling #4013
Open
+102
−18
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.
This PR allows you to control whether stocking hatches work with machine controller covers.
From my understanding, here's how stocking hatches work:
When the multi does a recipe check, the stocking hatch will update its available stacks. It does a simulated extraction on the AE system, then stores the resulting stack in an array (right group in the UI), along with its amount (in another array). These arrays match 1:1 with the configured stacks (left group). When a multi scans the hatch, it 'consumes' these fake stacks. At the end of the recipe check, the stocking hatch will determine what was consumed by subtracting the starting counts from the ending counts, then extracting & deleting those stacks from the AE system. If this extraction fails, the stocking hatch shuts down the multi with a critical failure.
My change intercepts the initial simulated extraction. If the hatch is disabled, the hatch will function like the AE system had no matching stacks in it - the multi won't see any stacks and will not consume them in its recipe check. This should be a relatively simple change, but I'd like to test this relatively well in the nightlies first.
Code changes:
onEnableWorking
to MTEsjustHadNewXYZ
inonEnableWorking
if recipe checks are expeditedjustUpdated()
)Testing done: