diff --git a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java index b07d218c..32bd7d34 100644 --- a/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java +++ b/mechanical/src/main/java/resonantinduction/mechanical/fluid/pipe/PartPipe.java @@ -60,15 +60,6 @@ public class PartPipe extends PartFramedConnection 0) + { + float percentage = (float) fluid.amount / (float) capacity; + int[] displayList = RenderFluidHelper.getFluidDisplayLists(fluid, part.world(), false); + RenderUtility.bind(RenderFluidHelper.getFluidSheet(fluid)); + + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + GL11.glTranslatef((float) x + 0.3f, (float) y + 0.35f, (float) z + 0.3f); + GL11.glScalef(0.4f, 0.3f, 0.4f); + + GL11.glCallList(displayList[(int) (percentage * (RenderFluidHelper.DISPLAY_STAGES - 1))]); + + GL11.glPopAttrib(); + GL11.glPopMatrix(); + + for (ForgeDirection direction : ForgeDirection.VALID_DIRECTIONS) + { + if (RenderUtility.canRenderSide(renderSides, direction)) + { + GL11.glPushMatrix(); + GL11.glPushAttrib(GL11.GL_ENABLE_BIT); + GL11.glEnable(GL11.GL_CULL_FACE); + GL11.glDisable(GL11.GL_LIGHTING); + GL11.glEnable(GL11.GL_BLEND); + GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); + + switch (direction.ordinal()) + { + case 4: + GL11.glTranslatef((float) x + 0F, (float) y + 0.35f, (float) z + 0.3F); + break; + case 5: + GL11.glTranslatef((float) x + 0.7F, (float) y + 0.35f, (float) z + 0.3F); + break; + case 2: + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.35f, (float) z + 0F); + break; + case 3: + GL11.glTranslatef((float) x + 0.3F, (float) y + 0.35f, (float) z + 0.7F); + break; + } + + GL11.glScalef(0.4f, 0.3f, 0.4f); + GL11.glCallList(displayList[(int) (percentage * (RenderFluidHelper.DISPLAY_STAGES - 1))]); + + GL11.glPopAttrib(); + GL11.glPopMatrix(); + } + } + } + GL11.glPushMatrix(); GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F); GL11.glScalef(1.0F, -1F, -1F); diff --git a/src/main/resources/assets/resonantinduction/models/pipe.png b/src/main/resources/assets/resonantinduction/models/pipe.png index b5d6b63c..0414b799 100644 Binary files a/src/main/resources/assets/resonantinduction/models/pipe.png and b/src/main/resources/assets/resonantinduction/models/pipe.png differ