Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Duplication Glitch with ME Storage Hatches/Buses #2646

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

IntegerLimit
Copy link
Contributor

@IntegerLimit IntegerLimit commented Oct 23, 2024

What

This PR fixes a specific ME Stocking Bus/Hatch duplication glitch, which whilst not as common as the one fixed by #2608, can still be accidentally created.

Issue is as described in #2530. Specifically, it was reproduced as such:

  1. Setup a small AE2 System, with item cells, crafting terminal and power
  2. Setup 2 MultiSmelters and 2 PAs. Setup the PAs to run macerator.
  3. Add stocking buses to all multis. No sharing. Setup PA buses to take in iron ingots, multismelters to take in iron dust.
  4. Add ME output buses to all multis.
  5. Add in Iron Ingots or Iron Dust. Wait a few moments, and watch the iron amount increase. Unset the stocking hatch to see all iron dust/ingot return, and note that the amount has increased.

Implementation Details

There are several parts of this PR that could be looked over:

  • The Stocking Buses/Hatches are added to a 'list' of 'reload/refresh before consume' MTEs. Is there a better way to do this? We can't mess with the abilities.
  • The specific timing for refreshing the stocking buses/hatches
    • This PR refreshes the buses/hatches at the beginning of prepareRecipe, meaning it is not called for every recipe search, just when a recipe is found, and is called before OC and Parallel handling, allowing for the recipe logic to exit with invalid recipes, based on inputs.
    • Experiment was conducted with refreshing in setupAndConsumeRecipeInputs instead, but invalid inputs there do not stop the recipe from running.

Outcome

Fixes #2530

Additional Information

Setup: (GCYM was not used to reduce variables, and due to incompatibility with GT Master State)
2024-10-23_22 39 35

Potential Compatibility Issues

Perhaps may not work with addons that override the prepareRecipe function.

@IntegerLimit IntegerLimit requested a review from a team as a code owner October 23, 2024 11:45
@IntegerLimit
Copy link
Contributor Author

Adding to the point on reloading when consuming the inputs, if this was really implemented, and made to fail the running of the recipe, there would be no way to recalculate OC or parallel without running the entirety of find recipe again.

@Zorbatron Zorbatron added the type: bug Something isn't working label Oct 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

(Advanced) ME stocking busses are duping items
2 participants