}
@Override
public void render(RenderCart renderer, EntityMinecart cart, float light, float time) {
super.render(renderer, cart, light, time);
EntityCartTank cartTank = (EntityCartTank) cart;
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glTranslatef(0.0F, 0.3125F, 0.0F);
GL11.glRotatef(90F, 0.0F, 1.0F, 0.0F);
GL11.glDisable(2896 /*GL_LIGHTING*/);
int x = (int) (Math.floor(cart.posX));
int y = (int) (Math.floor(cart.posY));
int z = (int) (Math.floor(cart.posZ));
IFluidTank tank = cartTank.getTankManager().get(0);
FluidStack fluidStack = tank.getFluid();
if (fluidStack != null && fluidStack.amount > 0) {
Fluid fluid = fluidStack.getFluid();
int[] displayLists = FluidRenderer.getLiquidDisplayLists(fluidStack);
if (fluid != null && displayLists != null) {
GL11.glPushMatrix();
GL11.glPushAttrib(GL11.GL_ENABLE_BIT);
GL11.glEnable(GL11.GL_BLEND);
GL11.glTranslatef(0, 0.0625f, 0);
float cap = tank.getCapacity();
float level = (float) Math.min(fluidStack.amount, cap) / cap;
renderer.bindTex(FluidRenderer.getFluidSheet(fluidStack));
FluidRenderer.setColorForFluidStack(fluidStack);
GL11.glCallList(displayLists[(int) (level * (float) (FluidRenderer.DISPLAY_STAGES - 1))]);
if (cartTank.isFilling()) {
ResourceLocation texSheet = FluidRenderer.setupFlowingLiquidTexture(fluidStack, fillBlock.texture);
if (texSheet != null) {
renderer.bindTex(texSheet);
RenderFakeBlock.renderBlockForEntity(fillBlock, cart.worldObj, x, y, z, false, true);
}
}
GL11.glPopAttrib();
GL11.glPopMatrix();
}
}
ItemStack bucket = cartTank.getFilterItem();
if (bucket != null && bucket.getItem() != null) {
GL11.glPushMatrix();
GL11.glScalef(FILTER_SCALE_X, FILTER_SCALE_Y, FILTER_SCALE_Z);