Improved fluid height calculation expression...

...to properly respect maxHeight
This commit is contained in:
Arthur Uzulin committed 2013-10-19 22:56:12 +11:00
1 parent 1fadcfbf59
commit 1115fe8c7d
1 file changed
+7 -2
@@ -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();