fixed the spring causing an overflow if connected to an overeager pipe

This commit is contained in:
Ell 2020-10-19 20:30:55 +02:00
parent 9eb52c3b71
commit 5c5988f8a7

View file

@ -143,17 +143,17 @@ public class TileEntitySpring extends TileEntityImpl implements ITickableTileEnt
private class InfiniteTank implements IFluidTank { private class InfiniteTank implements IFluidTank {
@Override @Override
public FluidStack getFluid() { public FluidStack getFluid() {
return new FluidStack(Fluids.WATER, Integer.MAX_VALUE); return new FluidStack(Fluids.WATER, 1000);
} }
@Override @Override
public int getFluidAmount() { public int getFluidAmount() {
return Integer.MAX_VALUE; return 1000;
} }
@Override @Override
public int getCapacity() { public int getCapacity() {
return Integer.MAX_VALUE; return 1000;
} }
@Override @Override
@ -168,9 +168,10 @@ public class TileEntitySpring extends TileEntityImpl implements ITickableTileEnt
@Override @Override
public FluidStack drain(int maxDrain, IFluidHandler.FluidAction action) { public FluidStack drain(int maxDrain, IFluidHandler.FluidAction action) {
int drain = Math.min(maxDrain, 1000);
if (action.execute()) if (action.execute())
TileEntitySpring.this.consumeAura(2 * maxDrain); TileEntitySpring.this.consumeAura(2 * drain);
return new FluidStack(Fluids.WATER, maxDrain); return new FluidStack(Fluids.WATER, drain);
} }
@Override @Override