    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005    import org.lwjgl.opengl.GL11;
    006
    007    @SideOnly(Side.CLIENT)
    008    public class RenderGhast extends RenderLiving
    009    {
    010        public RenderGhast()
    011        {
    012            super(new ModelGhast(), 0.5F);
    013        }
    014
    015        /**
    016         * Pre-Renders the Ghast.
    017         */
    018        protected void preRenderGhast(EntityGhast par1EntityGhast, float par2)
    019        {
    020            float var4 = ((float)par1EntityGhast.prevAttackCounter + (float)(par1EntityGhast.attackCounter - par1EntityGhast.prevAttackCounter) * par2) / 20.0F;
    021
    022            if (var4 < 0.0F)
    023            {
    024                var4 = 0.0F;
    025            }
    026
    027            var4 = 1.0F / (var4 * var4 * var4 * var4 * var4 * 2.0F + 1.0F);
    028            float var5 = (8.0F + var4) / 2.0F;
    029            float var6 = (8.0F + 1.0F / var4) / 2.0F;
    030            GL11.glScalef(var6, var5, var6);
    031            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    032        }
    033
    034        /**
    035         * Allows the render to do any OpenGL state modifications necessary before the model is rendered. Args:
    036         * entityLiving, partialTickTime
    037         */
    038        protected void preRenderCallback(EntityLiving par1EntityLiving, float par2)
    039        {
    040            this.preRenderGhast((EntityGhast)par1EntityLiving, par2);
    041        }
    042    }