From 02caa137ba572f7668e11c61901e96e1dedd4969 Mon Sep 17 00:00:00 2001 From: den Date: Sun, 2 Dec 2012 19:31:11 -0500 Subject: [PATCH] Fixed RenderPipe crash if pipe has a higher capacity than normal. (needed for Valve Pipe (and more!)'s Industrial Pipes) --- common/buildcraft/transport/render/RenderPipe.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/common/buildcraft/transport/render/RenderPipe.java b/common/buildcraft/transport/render/RenderPipe.java index 3b8bc71f..b31aa766 100644 --- a/common/buildcraft/transport/render/RenderPipe.java +++ b/common/buildcraft/transport/render/RenderPipe.java @@ -58,7 +58,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { private final static EntityItem dummyEntityItem = new EntityItem(null); private class DisplayLiquidList { - + public int[] sideHorizontal = new int[displayLiquidStages]; public int[] sideVertical = new int[displayLiquidStages]; public int[] centerHorizontal = new int[displayLiquidStages]; @@ -311,7 +311,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { if (d == null) continue; - int stage = (int) ((float) liquid.amount / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); + int stage = (int) ((float) liquid.amount / (float) (liq.getTanks(ForgeDirection.UNKNOWN)[0].getCapacity()) * (displayLiquidStages - 1)); GL11.glPushMatrix(); int list = 0; @@ -353,7 +353,7 @@ public class RenderPipe extends TileEntitySpecialRenderer { DisplayLiquidList d = getListFromBuffer(liquid, pipe.worldObj); if (d != null) { - int stage = (int) ((float) liquid.amount / (float) (PipeTransportLiquids.LIQUID_IN_PIPE) * (displayLiquidStages - 1)); + int stage = (int) ((float) liquid.amount / (float) (liq.getTanks(ForgeDirection.UNKNOWN)[0].getCapacity()) * (displayLiquidStages - 1)); if (above) GL11.glCallList(d.centerVertical[stage]);