Implemented maxFlow rate in pipe network fill methods
This commit is contained in:
parent
a2a8f8c5e1
commit
7da8ac4289
1 changed files with 2 additions and 9 deletions
|
@ -40,16 +40,8 @@ public class PipeNetwork extends FluidNetwork
|
||||||
{
|
{
|
||||||
int volPer = (stack.amount / count);
|
int volPer = (stack.amount / count);
|
||||||
int volPerSide = (volPer / sideCount);
|
int volPerSide = (volPer / sideCount);
|
||||||
int maxFill = 1000;
|
|
||||||
|
|
||||||
TileEntity tile = new Vector3((TileEntity) entry.getKey()).modifyPositionFromSide(dir).getTileEntity(((TileEntity) entry.getKey()).worldObj);
|
stack.amount -= entry.getKey().fill(dir, FluidUtility.getStack(stack, Math.min(volPerSide, this.maxFlowRate)), true);
|
||||||
|
|
||||||
if (tile instanceof IFluidPipe)
|
|
||||||
{
|
|
||||||
maxFill = ((IFluidPipe) tile).getMaxFlowRate();
|
|
||||||
}
|
|
||||||
|
|
||||||
stack.amount -= entry.getKey().fill(dir, FluidUtility.getStack(stack, Math.min(volPerSide, maxFill)), true);
|
|
||||||
|
|
||||||
if (sideCount > 1)
|
if (sideCount > 1)
|
||||||
--sideCount;
|
--sideCount;
|
||||||
|
@ -89,6 +81,7 @@ public class PipeNetwork extends FluidNetwork
|
||||||
{
|
{
|
||||||
this.connectionMap.clear();
|
this.connectionMap.clear();
|
||||||
this.maxFlowRate = Integer.MAX_VALUE;
|
this.maxFlowRate = Integer.MAX_VALUE;
|
||||||
|
this.maxPressure = Integer.MAX_VALUE;
|
||||||
super.reconstruct();
|
super.reconstruct();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue