Skip to content

Commit

Permalink
fixed fluid handler extracting too much fluid
Browse files Browse the repository at this point in the history
  • Loading branch information
Trinsdar committed Sep 13, 2023
1 parent 57f86b1 commit 92c7d3f
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ public FluidHolder extractFluid(FluidHolder fluid, boolean simulate) {
public FluidHolder extractFluid(long toExtract, boolean simulate) {
if (getOutputTanks() != null){
for (int i = 0; i < getOutputTanks().getSize(); i++) {
FluidHolder fluid = getOutputTanks().extractFluid(getOutputTanks().getFluidInTank(i), simulate);
FluidHolder toExtractFluid = getOutputTanks().getFluidInTank(i);
FluidHolder fluid = getOutputTanks().extractFluid(toExtractFluid.copyWithAmount(Math.min(toExtractFluid.getFluidAmount(), toExtract)), simulate);
if (!fluid.isEmpty()) return fluid;
}
}
Expand Down

0 comments on commit 92c7d3f

Please sign in to comment.