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 creative tanks only outputting up to 1kL at a time #2685

Merged
merged 2 commits into from
Jan 19, 2025

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.

Verified

This commit was signed with the committer’s verified signature.
Zorbatron Zorbatron
@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

Verified

This commit was signed with the committer’s verified signature.
Zorbatron Zorbatron
@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.

None yet

2 participants