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

feat: inventory check inspects large fluid containers #18

Merged
merged 4 commits into from
Dec 27, 2024

Conversation

mainrs
Copy link

@mainrs mainrs commented Sep 15, 2024

The commit adds the necessary code to check large fluid cells for their liquid content. In these cases, it now generates an instance of LFluidStack instead of LItemStack. This does mean that recipes requiring large fluid stacks filled with a liquid might mis-behave, but I could not find any such recipes. A potential fix to this is to return a Collection<ILabel> instead of a single ILabel from the ILabel.Converter#from method.

I tried that, but I wasn't too sure about the implications on other code parts, so I left it out (there were three places that required changes).

There are also other fluid containers (I think they are from Forestry?) in GTNH, but those are used as normal item ingredients in recipes. Therefore, I didn't add them in this PR. I am also not sure if they can be used to fill machines with their contents.

Fixes #10.

@mainrs
Copy link
Author

mainrs commented Sep 15, 2024

There is one thing I do not like: I check against the item being an instance of MetaItem.01. But those can be a bunch of items. However, the meta value/damage is not the same during runtime as it is inside the source code. The steel fluid cell has a meta value of 405, but during runtime its 32405. I am not too sure how to handle this properly.
That's why I check for the right item, and then ensure it's a fluid container by checking if it contains a fluid item stack.

@Dream-Master Dream-Master requested a review from a team September 15, 2024 10:36
@Dream-Master Dream-Master merged commit eba71ca into GTNewHorizons:master Dec 27, 2024
1 check passed
@mainrs mainrs deleted the feat/inventory-fluids branch December 27, 2024 10:03
@serenibyss serenibyss mentioned this pull request Dec 29, 2024
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants