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 ME output hatch void protection again #3594

Merged
merged 2 commits into from
Dec 2, 2024
Merged

Conversation

serenibyss
Copy link
Member

@serenibyss serenibyss commented Dec 2, 2024

ME output hatch void protection had 4 different issues at different points:

  1. Mixing ME output hatch + normal output hatch on a DT (or dangote, MDT, sparge tower) can't run with fluid void protection on
  2. Multiple ME output hatches, or ME output hatch + unfiltered normal output hatch breaks fluid void protection fully
  3. ME output hatch can only hold 1 fluid according to void protection, requiring multiple for multi fluid output
  4. ME output hatch can void some but not all fluids of a recipe that outputs multiple fluids at once

ME output hatches gaining a limited capacity introduced bugs 1, 2, and 3.
#3585 fixed bug 1, but introduced bug 3. Bug 2 and 4 remained unfixed with that PR.

This PR fixes bugs 1, 2, and 3:

  1. Fixed by the checks in VoidProtectionHelper in the second commit
    • By testing for an ME output hatch, we can check if some amount of fluid can be stored in this hatch, and proceed as usual if so. Previously, this code would always view an ME output hatch as not being able to hold any fluid
  2. Fixed by the check in MTEMultiBlockBase in the second commit
    • By checking if the tested hatch is an ME output hatch, we can see if this hatch has room to hold a fluid. If it does, we can safely insert any amount of fluid into it. If it does not, then we skip this hatch to test others. Previously, this code would blindly fill an ME output hatch, as a call to fill() on these hatches always claims to accept all fluid, regardless of if it actually can due to the cross-over between forge fluid api and AE2 api
  3. Fixed by reverting Fix ME Output Hatch void protection checks #3585
    • This PR conformed ME output hatches to normal void protection rules. However, this code is not written in a way that allows a single hatch to store multiple fluids
  4. Not fixed by this PR
    • Fixing this I believe will require a more thorough rewrite. Basically, void protection assumes that an ME output hatch can hold any amount of fluid, since ME output hatches can be "overfilled" to try and avoid voiding fluids. However, when a recipe outputs multiple fluids, void protection makes this assumption, but fill logic tries to fill the hatch multiple times. This can lead to some of the later fill calls not being able to fit, as the hatch is not able to be overfilled by multiple fill calls.
    • Solution for later: Implement a transactional system to fill the ME output hatch with multiple fluids at a time, OR rewrite void protection to not need to make this assumption with ME output hatches

Closes GTNewHorizons/GT-New-Horizons-Modpack#17711

@serenibyss serenibyss added the bug fix Fix a bug. Please link it in the PR. label Dec 2, 2024
@serenibyss serenibyss requested a review from a team December 2, 2024 05:08
@serenibyss serenibyss merged commit 62b6fc8 into master Dec 2, 2024
5 of 6 checks passed
@serenibyss serenibyss deleted the fix-void-protection branch December 2, 2024 14:12
Sanduhr32 pushed a commit to Sanduhr32/GT5-Unofficial that referenced this pull request Dec 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug fix Fix a bug. Please link it in the PR.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Distillation Towers Do Not Recognize Space in ME Hatches for void protection
2 participants