diff --git a/archaic/src/main/java/resonantinduction/archaic/fluid/gutter/RenderGutter.java b/archaic/src/main/java/resonantinduction/archaic/fluid/gutter/RenderGutter.java index 23d3bc77..cc14a3a5 100644 --- a/archaic/src/main/java/resonantinduction/archaic/fluid/gutter/RenderGutter.java +++ b/archaic/src/main/java/resonantinduction/archaic/fluid/gutter/RenderGutter.java @@ -88,10 +88,10 @@ public class RenderGutter extends TileEntitySpecialRenderer implements ISimpleIt FluidTank tank = ((TileGutter) tileEntity).getInternalTank(); double percentageFilled = (double) tank.getFluidAmount() / (double) tank.getCapacity(); - double ySouthEast = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.EAST); - double yNorthEast = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.EAST); - double ySouthWest = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.WEST); - double yNorthWest = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.WEST); + double ySouthEast = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.EAST); + double yNorthEast = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.EAST); + double ySouthWest = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.WEST); + double yNorthWest = FluidUtility.getAveragePercentageFilledForSides(TileGutter.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.WEST); FluidRenderUtility.renderFluidTesselation(tank, ySouthEast, yNorthEast, ySouthWest, yNorthWest); GL11.glPopMatrix(); diff --git a/archaic/src/main/java/resonantinduction/archaic/fluid/tank/RenderTank.java b/archaic/src/main/java/resonantinduction/archaic/fluid/tank/RenderTank.java index e256f3fc..d27263f8 100644 --- a/archaic/src/main/java/resonantinduction/archaic/fluid/tank/RenderTank.java +++ b/archaic/src/main/java/resonantinduction/archaic/fluid/tank/RenderTank.java @@ -67,10 +67,10 @@ public class RenderTank extends TileEntitySpecialRenderer implements ISimpleItem FluidTank tank = ((TileTank) tileEntity).getInternalTank(); double percentageFilled = (double) tank.getFluidAmount() / (double) tank.getCapacity(); - double ySouthEast = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.EAST); - double yNorthEast = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.EAST); - double ySouthWest = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.WEST); - double yNorthWest = FluidUtility.getAveragePercentageFilledForSides(percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.WEST); + double ySouthEast = FluidUtility.getAveragePercentageFilledForSides(TileTank.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.EAST); + double yNorthEast = FluidUtility.getAveragePercentageFilledForSides(TileTank.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.EAST); + double ySouthWest = FluidUtility.getAveragePercentageFilledForSides(TileTank.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.SOUTH, ForgeDirection.WEST); + double yNorthWest = FluidUtility.getAveragePercentageFilledForSides(TileTank.class, percentageFilled, tileEntity.worldObj, new Vector3(tileEntity), ForgeDirection.NORTH, ForgeDirection.WEST); FluidRenderUtility.renderFluidTesselation(tank, ySouthEast, yNorthEast, ySouthWest, yNorthWest); } else diff --git a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java index 33b46650..31257d96 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java @@ -49,59 +49,64 @@ public class PartPipe extends PartFramedNode= pressureB) { FluidTank tankA = parent.getPressureTank(); - FluidStack fluidA = tankA.getFluid(); - if (tankA != null && fluidA != null) + if (tankA != null) { - int amountA = fluidA.amount; + FluidStack fluidA = tankA.getFluid(); - if (amountA > 0) + if (fluidA != null) { - FluidTank tankB = otherPipe.parent.getPressureTank(); + int amountA = fluidA.amount; - if (tankB != null) + if (amountA > 0) { - int amountB = tankB.getFluidAmount(); + FluidTank tankB = otherPipe.parent.getPressureTank(); - int quantity = Math.max(pressureA > pressureB ? (pressureA - pressureB) * getMaxFlowRate() : 0, Math.min((amountA - amountB) / 2, getMaxFlowRate())); - quantity = Math.min(Math.min(quantity, tankB.getCapacity() - amountB), amountA); - - if (quantity > 0) + if (tankB != null) { - FluidStack drainStack = parent.drain(dir.getOpposite(), quantity, false); + int amountB = tankB.getFluidAmount(); - if (drainStack != null && drainStack.amount > 0) - parent.drain(dir.getOpposite(), otherPipe.parent.fill(dir, drainStack, true), true); + int quantity = Math.max(pressureA > pressureB ? (pressureA - pressureB) * getMaxFlowRate() : 0, Math.min((amountA - amountB) / 2, getMaxFlowRate())); + quantity = Math.min(Math.min(quantity, tankB.getCapacity() - amountB), amountA); + + if (quantity > 0) + { + FluidStack drainStack = parent.drain(dir.getOpposite(), quantity, false); + + if (drainStack != null && drainStack.amount > 0) + parent.drain(dir.getOpposite(), otherPipe.parent.fill(dir, drainStack, true), true); + } } } } @@ -166,7 +170,7 @@ public class PressureNode extends Node