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

Refactor FluidTankList and Filtered Handlers #2690

Draft
wants to merge 25 commits into
base: master
Choose a base branch
from

Conversation

ghzdude
Copy link
Contributor

@ghzdude ghzdude commented Dec 27, 2024

What

refactor/simplify fluid tank list
potentially fixes an issue when nesting fluid tanks with differing same fluid fill
yeet overlayed fluid handler because it was redundant
add filtering to base gt item/fluid handlers

Implementation Details

IMultipleTankHandler is now an abstract class
FluidTankList is now final
IFilteredHandler has a generic to set IFilter
notifiable fluid lists are now IFluidTank instead of handler (usually tanks are passed in, and i haven't observed any immediate issues)

Outcome

fluid tank list somewhat less sussy

Potential Compatibility Issues

a handful of classes are now deprecated, but they should still function for now

@ghzdude ghzdude added the type: refactor Suggestion to refactor a section of code label Dec 27, 2024
Comment on lines -105 to -107
if (!(fluidTank instanceof IFluidHandler))
throw new IllegalStateException(
"Container IO is only supported for fluid tanks that implement IFluidHandler");
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i do not know why this check was needed, as it's never required to be an IFluidHandler in the class.
either way, it'll be handled properly in the mui2 port

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: refactor Suggestion to refactor a section of code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant