    001package net.minecraft.client.renderer.entity;
    002
    003import cpw.mods.fml.relauncher.Side;
    004import cpw.mods.fml.relauncher.SideOnly;
    005import net.minecraft.block.Block;
    006import net.minecraft.entity.item.EntityMinecart;
    007import net.minecraft.entity.item.EntityMinecartTNT;
    008import org.lwjgl.opengl.GL11;
    009
    010@SideOnly(Side.CLIENT)
    011public class RenderTntMinecart extends RenderMinecart
    012{
    013    protected void func_94146_a(EntityMinecartTNT par1EntityMinecartTNT, float par2, Block par3Block, int par4)
    014    {
    015        int j = par1EntityMinecartTNT.func_94104_d();
    016
    017        if (j > -1 && (float)j - par2 + 1.0F < 10.0F)
    018        {
    019            float f1 = 1.0F - ((float)j - par2 + 1.0F) / 10.0F;
    020
    021            if (f1 < 0.0F)
    022            {
    023                f1 = 0.0F;
    024            }
    025
    026            if (f1 > 1.0F)
    027            {
    028                f1 = 1.0F;
    029            }
    030
    031            f1 *= f1;
    032            f1 *= f1;
    033            float f2 = 1.0F + f1 * 0.3F;
    034            GL11.glScalef(f2, f2, f2);
    035        }
    036
    037        super.func_94144_a(par1EntityMinecartTNT, par2, par3Block, par4);
    038
    039        if (j > -1 && j / 5 % 2 == 0)
    040        {
    041            GL11.glDisable(GL11.GL_TEXTURE_2D);
    042            GL11.glDisable(GL11.GL_LIGHTING);
    043            GL11.glEnable(GL11.GL_BLEND);
    044            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_DST_ALPHA);
    045            GL11.glColor4f(1.0F, 1.0F, 1.0F, (1.0F - ((float)j - par2 + 1.0F) / 100.0F) * 0.8F);
    046            GL11.glPushMatrix();
    047            this.field_94145_f.renderBlockAsItem(Block.tnt, 0, 1.0F);
    048            GL11.glPopMatrix();
    049            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    050            GL11.glDisable(GL11.GL_BLEND);
    051            GL11.glEnable(GL11.GL_LIGHTING);
    052            GL11.glEnable(GL11.GL_TEXTURE_2D);
    053        }
    054    }
    055
    056    protected void func_94144_a(EntityMinecart par1EntityMinecart, float par2, Block par3Block, int par4)
    057    {
    058        this.func_94146_a((EntityMinecartTNT)par1EntityMinecart, par2, par3Block, par4);
    059    }
    060}