Merge pull request #3572 from nphhpn/nphhpn-patch-1

Fix fluid dupe exploit with hose pulley
This commit is contained in:
simibubi 2022-08-13 14:40:07 +02:00 committed by GitHub
commit 16b17b3295
Failed to generate hash of commit

View file

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