This commit is contained in:
nphhpn 2022-08-03 14:32:09 +07:00 committed by GitHub
parent 826e29f0f3
commit b4c0657d8b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -25,12 +25,14 @@ public class HosePulleyFluidHandler implements IFluidHandler {
int diff = resource.getAmount(); int diff = resource.getAmount();
int totalAmountAfterFill = diff + internalTank.getFluidAmount(); int totalAmountAfterFill = diff + internalTank.getFluidAmount();
FluidStack remaining = resource.copy(); FluidStack remaining = resource.copy();
boolean deposited = false;
if (predicate.get() && totalAmountAfterFill >= 1000) { if (predicate.get() && totalAmountAfterFill >= 1000) {
if (filler.tryDeposit(resource.getFluid(), rootPosGetter.get(), action.simulate())) { if (filler.tryDeposit(resource.getFluid(), rootPosGetter.get(), action.simulate())) {
drainer.counterpartActed(); drainer.counterpartActed();
remaining.shrink(1000); remaining.shrink(1000);
diff -= 1000; diff -= 1000;
deposited = true;
} }
} }
@ -41,7 +43,7 @@ public class HosePulleyFluidHandler implements IFluidHandler {
return resource.getAmount(); return resource.getAmount();
} }
return internalTank.fill(remaining, action); return internalTank.fill(remaining, action) + (deposited ? 1000 : 0);
} }
@Override @Override