From 24ed8116dc815423009df25b238ae12de2d8a424 Mon Sep 17 00:00:00 2001 From: Robert Seifert Date: Mon, 3 Jun 2013 08:30:25 -0400 Subject: [PATCH] Fixed render crash if volume is greater than cap --- src/minecraft/dark/fluid/client/render/RenderTank.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/minecraft/dark/fluid/client/render/RenderTank.java b/src/minecraft/dark/fluid/client/render/RenderTank.java index 595640e1..ff47bbec 100644 --- a/src/minecraft/dark/fluid/client/render/RenderTank.java +++ b/src/minecraft/dark/fluid/client/render/RenderTank.java @@ -49,8 +49,7 @@ public class RenderTank extends TileEntitySpecialRenderer GL11.glTranslatef((float) x + 0.025F, (float) y, (float) z + 0.025F); GL11.glScalef(0.87F, 0.999F, 0.87F); - - GL11.glCallList(displayList[(int) ((float) liquid.amount / (float) (tank.getCapacity()) * (LiquidRenderer.DISPLAY_STAGES - 1))]); + GL11.glCallList(displayList[(int) ((float) Math.min(liquid.amount, tank.getCapacity()) / (float) (tank.getCapacity()) * (LiquidRenderer.DISPLAY_STAGES - 1))]); GL11.glPopAttrib(); GL11.glPopMatrix(); @@ -59,7 +58,7 @@ public class RenderTank extends TileEntitySpecialRenderer } bindTextureByName(FluidMech.MODEL_TEXTURE_DIRECTORY + "TankSide.png"); GL11.glPushMatrix(); - + GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glScalef(1.0F, -1F, -1F);