    001    package net.minecraft.src;
    002
    003    import cpw.mods.fml.common.Side;
    004    import cpw.mods.fml.common.asm.SideOnly;
    005
    006    @SideOnly(Side.CLIENT)
    007    public class EntityHeartFX extends EntityFX
    008    {
    009        float particleScaleOverTime;
    010
    011        public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12)
    012        {
    013            this(par1World, par2, par4, par6, par8, par10, par12, 2.0F);
    014        }
    015
    016        public EntityHeartFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, float par14)
    017        {
    018            super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
    019            this.motionX *= 0.009999999776482582D;
    020            this.motionY *= 0.009999999776482582D;
    021            this.motionZ *= 0.009999999776482582D;
    022            this.motionY += 0.1D;
    023            this.particleScale *= 0.75F;
    024            this.particleScale *= par14;
    025            this.particleScaleOverTime = this.particleScale;
    026            this.particleMaxAge = 16;
    027            this.noClip = false;
    028            this.setParticleTextureIndex(80);
    029        }
    030
    031        public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
    032        {
    033            float var8 = ((float)this.particleAge + par2) / (float)this.particleMaxAge * 32.0F;
    034
    035            if (var8 < 0.0F)
    036            {
    037                var8 = 0.0F;
    038            }
    039
    040            if (var8 > 1.0F)
    041            {
    042                var8 = 1.0F;
    043            }
    044
    045            this.particleScale = this.particleScaleOverTime * var8;
    046            super.renderParticle(par1Tessellator, par2, par3, par4, par5, par6, par7);
    047        }
    048
    049        /**
    050         * Called to update the entity's position/logic.
    051         */
    052        public void onUpdate()
    053        {
    054            this.prevPosX = this.posX;
    055            this.prevPosY = this.posY;
    056            this.prevPosZ = this.posZ;
    057
    058            if (this.particleAge++ >= this.particleMaxAge)
    059            {
    060                this.setDead();
    061            }
    062
    063            this.moveEntity(this.motionX, this.motionY, this.motionZ);
    064
    065            if (this.posY == this.prevPosY)
    066            {
    067                this.motionX *= 1.1D;
    068                this.motionZ *= 1.1D;
    069            }
    070
    071            this.motionX *= 0.8600000143051147D;
    072            this.motionY *= 0.8600000143051147D;
    073            this.motionZ *= 0.8600000143051147D;
    074
    075            if (this.onGround)
    076            {
    077                this.motionX *= 0.699999988079071D;
    078                this.motionZ *= 0.699999988079071D;
    079            }
    080        }
    081    }