Skip to content

Conversation

@Zorbatron
Copy link
Member

What

Fixes an issue with #1963 which made it so creative tanks would only push 1kL of fluid at a time.

Implementation Details

Is overriding getFluid in the creative tank handler a good idea or would it be better to re-add the stack.amount = mBPerCycle; that was removed in #1963?

Outcome

Creative tanks work again.

@Zorbatron Zorbatron requested a review from a team as a code owner December 20, 2024 17:11
@Zorbatron Zorbatron added the type: bug Something isn't working label Dec 20, 2024
Copy link
Contributor

@ghzdude ghzdude left a comment

Choose a reason for hiding this comment

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

i don't know how to feel about copying the fluid stack every time getFluid() is called. it might be better use the drain method instead of using getFluid() since drain essentially does the same thing

@Zorbatron
Copy link
Member Author

Do you think

FluidStack stack = fluidTank.getFluid();
int canInsertAmount = fluidHandler.fill(stack, false);
stack.amount = Math.min(mBPerCycle, canInsertAmount);

fluidHandler.fill(stack, true);

is even needed? I think that it could just be replaced with

fluidHandler.fill(fluidTank.drain(Integer.MAX_VALUE, false), true);

@ghzdude
Copy link
Contributor

ghzdude commented Jan 18, 2025

fluidHandler.fill(fluidTank.drain(Integer.MAX_VALUE, false), true);

i think this is good enough, but with mbPerCycle instead of max int

@ghzdude ghzdude merged commit c35fcb2 into master Jan 19, 2025
3 checks passed
@ghzdude ghzdude deleted the zb/creative-tank-fix branch January 19, 2025 20:31
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.

3 participants