From bf26e639d9f0bf01e1c37a16ee5bf3b8fc5baa61 Mon Sep 17 00:00:00 2001 From: Draco18s Date: Thu, 4 Dec 2014 16:50:26 -0500 Subject: [PATCH] Update RenderBlockFluid.java Added tessellator calls to render the block's back faces, so that the liquid properly renders when the player is immersed in the fluid. --- .../fluids/RenderBlockFluid.java | 22 ++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java b/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java index 3fb858c04..7e7058387 100644 --- a/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java +++ b/src/main/java/net/minecraftforge/fluids/RenderBlockFluid.java @@ -191,6 +191,11 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(x + 0, y + heightSW, z + 1, u1, v1); tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, u4, v4); tessellator.addVertexWithUV(x + 1, y + heightNE, z + 0, u3, v3); + + tessellator.addVertexWithUV(x + 0, y + heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 1, y + heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 1, y + heightSE, z + 1, u4, v4); + tessellator.addVertexWithUV(x + 0, y + heightSW, z + 1, u1, v1); } else { @@ -198,6 +203,11 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(x + 1, y + 1 - heightSE, z + 1, u4, v4); tessellator.addVertexWithUV(x + 0, y + 1 - heightSW, z + 1, u1, v1); tessellator.addVertexWithUV(x + 0, y + 1 - heightNW, z + 0, u2, v2); + + tessellator.addVertexWithUV(x + 1, y + 1 - heightNE, z + 0, u3, v3); + tessellator.addVertexWithUV(x + 0, y + 1 - heightNW, z + 0, u2, v2); + tessellator.addVertexWithUV(x + 0, y + 1 - heightSW, z + 1, u1, v1); + tessellator.addVertexWithUV(x + 1, y + 1 - heightSE, z + 1, u4, v4); } } @@ -304,6 +314,11 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(tx2, y + ty2, tz2, u2Flow, v2Flow); tessellator.addVertexWithUV(tx2, y + 0, tz2, u2Flow, v3Flow); tessellator.addVertexWithUV(tx1, y + 0, tz1, u1Flow, v3Flow); + + tessellator.addVertexWithUV(tx1, y + ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx1, y + 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + 0, tz2, u2Flow, v3Flow); + tessellator.addVertexWithUV(tx2, y + ty2, tz2, u2Flow, v2Flow); } else { @@ -311,6 +326,11 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler tessellator.addVertexWithUV(tx2, y + 1 - 0, tz2, u2Flow, v3Flow); tessellator.addVertexWithUV(tx2, y + 1 - ty2, tz2, u2Flow, v2Flow); tessellator.addVertexWithUV(tx1, y + 1 - ty1, tz1, u1Flow, v1Flow); + + tessellator.addVertexWithUV(tx1, y + 1 - 0, tz1, u1Flow, v3Flow); + tessellator.addVertexWithUV(tx1, y + 1 - ty1, tz1, u1Flow, v1Flow); + tessellator.addVertexWithUV(tx2, y + 1 - ty2, tz2, u2Flow, v2Flow); + tessellator.addVertexWithUV(tx2, y + 1 - 0, tz2, u2Flow, v3Flow); } } } @@ -334,4 +354,4 @@ public class RenderBlockFluid implements ISimpleBlockRenderingHandler if (icon != null) return icon; return ((TextureMap)Minecraft.getMinecraft().getTextureManager().getTexture(TextureMap.locationBlocksTexture)).getAtlasSprite("missingno"); } -} \ No newline at end of file +}