Fix Fluid Task Detection with Stacked Fluid Containers #125
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 fixes Fluid Tasks not working with certain stacked fluid containers, due to the default fluid container logic returning if the stack size is 1. For example, this happens with EnderIO Portable Tanks and GregTech CEu Fluid Cells.
See Nomi-CEu/Nomi-CEu#938 for more information on the problem.
Note: Consuming tries to consume partial amounts of the fluid container when possible (e.g. if consuming 1 Bucket, and the fluid container is a stack of 4, it will try to take away 250mB from each container), but when this is not possible (buckets or GT Universal Cells), it will instead consume all the fluid of all the containers. This may not be the best solution, but I cannot think of a better one, as we cannot just create a new ItemStack.
This has been tested in Nomi-CEu for a while, which contains many non-consumable fluid tasks. For consumable ones, there was testing conducted, when this feature was a mixin. Testing has not been performed on its integration into BQu, but it is the exact same code.