    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 EntityPickupFX extends EntityFX
    009    {
    010        private Entity entityToPickUp;
    011        private Entity entityPickingUp;
    012        private int age = 0;
    013        private int maxAge = 0;
    014
    015        /** renamed from yOffset to fix shadowing Entity.yOffset */
    016        private float yOffs;
    017
    018        public EntityPickupFX(World par1World, Entity par2Entity, Entity par3Entity, float par4)
    019        {
    020            super(par1World, par2Entity.posX, par2Entity.posY, par2Entity.posZ, par2Entity.motionX, par2Entity.motionY, par2Entity.motionZ);
    021            this.entityToPickUp = par2Entity;
    022            this.entityPickingUp = par3Entity;
    023            this.maxAge = 3;
    024            this.yOffs = par4;
    025        }
    026
    027        public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
    028        {
    029            float var8 = ((float)this.age + par2) / (float)this.maxAge;
    030            var8 *= var8;
    031            double var9 = this.entityToPickUp.posX;
    032            double var11 = this.entityToPickUp.posY;
    033            double var13 = this.entityToPickUp.posZ;
    034            double var15 = this.entityPickingUp.lastTickPosX + (this.entityPickingUp.posX - this.entityPickingUp.lastTickPosX) * (double)par2;
    035            double var17 = this.entityPickingUp.lastTickPosY + (this.entityPickingUp.posY - this.entityPickingUp.lastTickPosY) * (double)par2 + (double)this.yOffs;
    036            double var19 = this.entityPickingUp.lastTickPosZ + (this.entityPickingUp.posZ - this.entityPickingUp.lastTickPosZ) * (double)par2;
    037            double var21 = var9 + (var15 - var9) * (double)var8;
    038            double var23 = var11 + (var17 - var11) * (double)var8;
    039            double var25 = var13 + (var19 - var13) * (double)var8;
    040            int var27 = MathHelper.floor_double(var21);
    041            int var28 = MathHelper.floor_double(var23 + (double)(this.yOffset / 2.0F));
    042            int var29 = MathHelper.floor_double(var25);
    043            int var30 = this.getBrightnessForRender(par2);
    044            int var31 = var30 % 65536;
    045            int var32 = var30 / 65536;
    046            OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, (float)var31 / 1.0F, (float)var32 / 1.0F);
    047            GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
    048            var21 -= interpPosX;
    049            var23 -= interpPosY;
    050            var25 -= interpPosZ;
    051            RenderManager.instance.renderEntityWithPosYaw(this.entityToPickUp, (double)((float)var21), (double)((float)var23), (double)((float)var25), this.entityToPickUp.rotationYaw, par2);
    052        }
    053
    054        /**
    055         * Called to update the entity's position/logic.
    056         */
    057        public void onUpdate()
    058        {
    059            ++this.age;
    060
    061            if (this.age == this.maxAge)
    062            {
    063                this.setDead();
    064            }
    065        }
    066
    067        public int getFXLayer()
    068        {
    069            return 3;
    070        }
    071    }