if (tile instanceof TileTankIronValve) {
TileTankIronValve valve = (TileTankIronValve) tile;
if (valve.isFilling()) {
StandardTank tank = valve.getFillTank();
FluidStack fluidStack = tank.getFluid();
if (fluidStack != null && fluidStack.amount > 0 && fluidStack.getFluid() != null) {
GL11.glPushMatrix();
if (valve.getPattern().getPatternMarkerChecked(valve.getPatternPositionX(), valve.getPatternPositionY() - 1, valve.getPatternPositionZ()) == 'A') {
prepFillTexture(fluidStack);
int height = getTankHeight(valve);
float yOffset = height / 2f;
float vScale = height - 2f;
GL11.glTranslatef((float) x + 0.5F, (float) y + yOffset - height + 1, (float) z + 0.5F);
GL11.glScalef(1f, vScale, 1f);
draw(tank);
} else if (valve.getPattern().getPatternMarkerChecked(valve.getPatternPositionX() - 1, valve.getPatternPositionY(), valve.getPatternPositionZ()) == 'A') {
prepFillTexture(fluidStack);
float vScale = getVerticalScaleSide(valve);
float yOffset = 0.5f - vScale / 2f + RenderTools.PIXEL * 3;
GL11.glTranslatef((float) x - 0.5F + RenderTools.PIXEL * 5, (float) y + yOffset, (float) z + 0.5F);
GL11.glScalef(1f, vScale, 1f);
draw(tank);
} else if (valve.getPattern().getPatternMarkerChecked(valve.getPatternPositionX() + 1, valve.getPatternPositionY(), valve.getPatternPositionZ()) == 'A') {
prepFillTexture(fluidStack);
float vScale = getVerticalScaleSide(valve);
float yOffset = 0.5f - vScale / 2f + RenderTools.PIXEL * 3;
GL11.glTranslatef((float) x + 1.5F - RenderTools.PIXEL * 5, (float) y + yOffset, (float) z + 0.5F);
GL11.glScalef(1f, vScale, 1f);
draw(tank);
} else if (valve.getPattern().getPatternMarkerChecked(valve.getPatternPositionX(), valve.getPatternPositionY(), valve.getPatternPositionZ() - 1) == 'A') {
prepFillTexture(fluidStack);
float vScale = getVerticalScaleSide(valve);
float yOffset = 0.5f - vScale / 2f + RenderTools.PIXEL * 3;
GL11.glTranslatef((float) x + 0.5F, (float) y + yOffset, (float) z - 0.5F + RenderTools.PIXEL * 5);
GL11.glScalef(1f, vScale, 1f);
draw(tank);
} else if (valve.getPattern().getPatternMarkerChecked(valve.getPatternPositionX(), valve.getPatternPositionY(), valve.getPatternPositionZ() + 1) == 'A') {
prepFillTexture(fluidStack);
float vScale = getVerticalScaleSide(valve);
float yOffset = 0.5f - vScale / 2f + RenderTools.PIXEL * 3;
GL11.glTranslatef((float) x + 0.5F, (float) y + yOffset, (float) z + 1.5F - RenderTools.PIXEL * 5);
GL11.glScalef(1f, vScale, 1f);
draw(tank);
}
GL11.glPopMatrix();
}
}
}
TileTankBase ironTank = (TileTankBase) tile;
if (!ironTank.isMaster() || ironTank.isInvalid())
return;
int height = getTankHeight(ironTank);
float yOffset = height / 2f;
float vScale = height - 2;
float hScale = ironTank.getPattern().getPatternWidthX() - 2;
TankManager tankManager = ironTank.getTankManager();
if (tankManager == null)
return;
StandardTank tank = tankManager.get(0);
if (tank == null)
return;
FluidStack fluidStack = tank.getFluid();
if (fluidStack != null && fluidStack.amount > 0 && fluidStack.getFluid() != null) {
preGL();
GL11.glTranslatef((float) x + 0.5F, (float) y + yOffset + 0.01f, (float) z + 0.5F);
GL11.glScalef(hScale, vScale, hScale);
// GL11.glScalef(0.999f, 1, 0.999f);
int[] displayLists = FluidRenderer.getLiquidDisplayLists(fluidStack);
if (displayLists != null) {
GL11.glPushMatrix();
float cap = tank.getCapacity();
float level = (float) Math.min(fluidStack.amount, cap) / cap;
bindTexture(FluidRenderer.getFluidSheet(fluidStack));
FluidRenderer.setColorForTank(tank);
GL11.glCallList(displayLists[(int) (level * (float) (FluidRenderer.DISPLAY_STAGES - 1))]);