From 1115fe8c7d23358eb77ce802bb711dd85ff125ae Mon Sep 17 00:00:00 2001 From: Arthur Uzulin Date: Sat, 19 Oct 2013 22:55:38 +1100 Subject: [PATCH] Improved fluid height calculation expression... ...to properly respect maxHeight --- src/tconstruct/client/block/SearedRender.java | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/tconstruct/client/block/SearedRender.java b/src/tconstruct/client/block/SearedRender.java index d09c9890..7db88433 100644 --- a/src/tconstruct/client/block/SearedRender.java +++ b/src/tconstruct/client/block/SearedRender.java @@ -185,7 +185,9 @@ public class SearedRender implements ISimpleBlockRenderingHandler } } - float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) / 16F; + float percent = (float)logic.getLiquidAmount() / (float)logic.getCapacity(); + float height = percent * (maxHeight - minHeight); + //float height = logic.getLiquidAmount() / (logic.getCapacity() * 1.03F) / 16F; renderer.setRenderBounds(minX, minHeight, minZ, maxX, minHeight + height, maxZ); Fluid fluid = logic.liquid.getFluid(); @@ -402,7 +404,10 @@ public class SearedRender implements ISimpleBlockRenderingHandler maxZ = rec.fluidRenderProperties.maxZ; } } - float height = (logic.getLiquidAmount() / (logic.getCapacity() * 1.05F) * 0.6875F) / maxHeight; + float percent = (float)logic.getLiquidAmount() / (float)logic.getCapacity(); + float height = percent * (maxHeight - minHeight); + + //float height = (logic.getLiquidAmount() / (logic.getCapacity() * 1.05F) * 0.6875F) / maxHeight; renderer.setRenderBounds(minX, minHeight, minZ, maxX, minHeight + height, maxZ); Fluid fluid = logic.liquid.getFluid();