mirror of
https://github.com/Ellpeck/NaturesAura.git
synced 2024-11-26 05:08:34 +01:00
fixed the spring causing an overflow if connected to an overeager pipe
This commit is contained in:
parent
9eb52c3b71
commit
5c5988f8a7
1 changed files with 6 additions and 5 deletions
|
@ -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
|
||||||
|
|
Loading…
Reference in a new issue