    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 EntityFootStepFX extends EntityFX
    009    {
    010        private int field_70576_a = 0;
    011        private int field_70578_aq = 0;
    012        private RenderEngine currentFootSteps;
    013
    014        public EntityFootStepFX(RenderEngine par1RenderEngine, World par2World, double par3, double par5, double par7)
    015        {
    016            super(par2World, par3, par5, par7, 0.0D, 0.0D, 0.0D);
    017            this.currentFootSteps = par1RenderEngine;
    018            this.motionX = this.motionY = this.motionZ = 0.0D;
    019            this.field_70578_aq = 200;
    020        }
    021
    022        public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
    023        {
    024            float var8 = ((float)this.field_70576_a + par2) / (float)this.field_70578_aq;
    025            var8 *= var8;
    026            float var9 = 2.0F - var8 * 2.0F;
    027
    028            if (var9 > 1.0F)
    029            {
    030                var9 = 1.0F;
    031            }
    032
    033            var9 *= 0.2F;
    034            GL11.glDisable(GL11.GL_LIGHTING);
    035            float var10 = 0.125F;
    036            float var11 = (float)(this.posX - interpPosX);
    037            float var12 = (float)(this.posY - interpPosY);
    038            float var13 = (float)(this.posZ - interpPosZ);
    039            float var14 = this.worldObj.getLightBrightness(MathHelper.floor_double(this.posX), MathHelper.floor_double(this.posY), MathHelper.floor_double(this.posZ));
    040            this.currentFootSteps.bindTexture(this.currentFootSteps.getTexture("/misc/footprint.png"));
    041            GL11.glEnable(GL11.GL_BLEND);
    042            GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
    043            par1Tessellator.startDrawingQuads();
    044            par1Tessellator.setColorRGBA_F(var14, var14, var14, var9);
    045            par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 + var10), 0.0D, 1.0D);
    046            par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 + var10), 1.0D, 1.0D);
    047            par1Tessellator.addVertexWithUV((double)(var11 + var10), (double)var12, (double)(var13 - var10), 1.0D, 0.0D);
    048            par1Tessellator.addVertexWithUV((double)(var11 - var10), (double)var12, (double)(var13 - var10), 0.0D, 0.0D);
    049            par1Tessellator.draw();
    050            GL11.glDisable(GL11.GL_BLEND);
    051            GL11.glEnable(GL11.GL_LIGHTING);
    052        }
    053
    054        /**
    055         * Called to update the entity's position/logic.
    056         */
    057        public void onUpdate()
    058        {
    059            ++this.field_70576_a;
    060
    061            if (this.field_70576_a == this.field_70578_aq)
    062            {
    063                this.setDead();
    064            }
    065        }
    066
    067        public int getFXLayer()
    068        {
    069            return 3;
    070        }
    071    }