Don't render fluid in disconnected pipes
This commit is contained in:
parent
0cbc63e919
commit
5dd82d7a95
1 changed files with 41 additions and 36 deletions
|
@ -593,49 +593,54 @@ public class PipeRendererTESR extends TileEntitySpecialRenderer {
|
||||||
|
|
||||||
boolean sides = false, above = false;
|
boolean sides = false, above = false;
|
||||||
|
|
||||||
for (int i = 0; i < 6; ++i) {
|
for (ForgeDirection side : ForgeDirection.VALID_DIRECTIONS) {
|
||||||
|
int i = side.ordinal();
|
||||||
|
|
||||||
FluidStack fluidStack = trans.renderCache[i];
|
FluidStack fluidStack = trans.renderCache[i];
|
||||||
|
|
||||||
if (fluidStack != null && fluidStack.amount > 0) {
|
if (fluidStack == null || fluidStack.amount <= 0)
|
||||||
DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.worldObj);
|
continue;
|
||||||
|
|
||||||
if (d == null) {
|
if (!pipe.container.isPipeConnected(side))
|
||||||
continue;
|
continue;
|
||||||
}
|
|
||||||
|
|
||||||
int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));
|
DisplayFluidList d = getListFromBuffer(fluidStack, pipe.container.worldObj);
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
if (d == null)
|
||||||
int list = 0;
|
continue;
|
||||||
|
|
||||||
switch (ForgeDirection.VALID_DIRECTIONS[i]) {
|
int stage = (int) ((float) fluidStack.amount / (float) (trans.getCapacity()) * (LIQUID_STAGES - 1));
|
||||||
case UP:
|
|
||||||
above = true;
|
GL11.glPushMatrix();
|
||||||
list = d.sideVertical[stage];
|
int list = 0;
|
||||||
break;
|
|
||||||
case DOWN:
|
switch (ForgeDirection.VALID_DIRECTIONS[i]) {
|
||||||
GL11.glTranslatef(0, -0.75F, 0);
|
case UP:
|
||||||
list = d.sideVertical[stage];
|
above = true;
|
||||||
break;
|
list = d.sideVertical[stage];
|
||||||
case EAST:
|
break;
|
||||||
case WEST:
|
case DOWN:
|
||||||
case SOUTH:
|
GL11.glTranslatef(0, -0.75F, 0);
|
||||||
case NORTH:
|
list = d.sideVertical[stage];
|
||||||
sides = true;
|
break;
|
||||||
// Yes, this is kind of ugly, but was easier than transform the coordinates above.
|
case EAST:
|
||||||
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
|
case WEST:
|
||||||
GL11.glRotatef(angleY[i], 0, 1, 0);
|
case SOUTH:
|
||||||
GL11.glRotatef(angleZ[i], 0, 0, 1);
|
case NORTH:
|
||||||
GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
|
sides = true;
|
||||||
list = d.sideHorizontal[stage];
|
// Yes, this is kind of ugly, but was easier than transform the coordinates above.
|
||||||
break;
|
GL11.glTranslatef(0.5F, 0.0F, 0.5F);
|
||||||
default:
|
GL11.glRotatef(angleY[i], 0, 1, 0);
|
||||||
}
|
GL11.glRotatef(angleZ[i], 0, 0, 1);
|
||||||
bindTexture(TextureMap.locationBlocksTexture);
|
GL11.glTranslatef(-0.5F, 0.0F, -0.5F);
|
||||||
FluidRenderer.setColorForFluidStack(fluidStack);
|
list = d.sideHorizontal[stage];
|
||||||
GL11.glCallList(list);
|
break;
|
||||||
GL11.glPopMatrix();
|
default:
|
||||||
}
|
}
|
||||||
|
bindTexture(TextureMap.locationBlocksTexture);
|
||||||
|
FluidRenderer.setColorForFluidStack(fluidStack);
|
||||||
|
GL11.glCallList(list);
|
||||||
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
// CENTER
|
// CENTER
|
||||||
FluidStack fluidStack = trans.renderCache[ForgeDirection.UNKNOWN.ordinal()];
|
FluidStack fluidStack = trans.renderCache[ForgeDirection.UNKNOWN.ordinal()];
|
||||||
|
|
Loading…
Reference in a new issue