mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-11-05 22:28:58 +01:00
Merge pull request #3572 from nphhpn/nphhpn-patch-1
Fix fluid dupe exploit with hose pulley
This commit is contained in:
commit
16b17b3295
1 changed files with 3 additions and 1 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue