    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 EntityBreakingFX extends EntityFX
    008    {
    009        public EntityBreakingFX(World par1World, double par2, double par4, double par6, Item par8Item)
    010        {
    011            super(par1World, par2, par4, par6, 0.0D, 0.0D, 0.0D);
    012            this.setParticleTextureIndex(par8Item.getIconFromDamage(0));
    013            this.particleRed = this.particleGreen = this.particleBlue = 1.0F;
    014            this.particleGravity = Block.blockSnow.blockParticleGravity;
    015            this.particleScale /= 2.0F;
    016        }
    017
    018        public EntityBreakingFX(World par1World, double par2, double par4, double par6, double par8, double par10, double par12, Item par14Item)
    019        {
    020            this(par1World, par2, par4, par6, par14Item);
    021            this.motionX *= 0.10000000149011612D;
    022            this.motionY *= 0.10000000149011612D;
    023            this.motionZ *= 0.10000000149011612D;
    024            this.motionX += par8;
    025            this.motionY += par10;
    026            this.motionZ += par12;
    027        }
    028
    029        public int getFXLayer()
    030        {
    031            return 2;
    032        }
    033
    034        public void renderParticle(Tessellator par1Tessellator, float par2, float par3, float par4, float par5, float par6, float par7)
    035        {
    036            float var8 = ((float)(this.getParticleTextureIndex() % 16) + this.particleTextureJitterX / 4.0F) / 16.0F;
    037            float var9 = var8 + 0.015609375F;
    038            float var10 = ((float)(this.getParticleTextureIndex() / 16) + this.particleTextureJitterY / 4.0F) / 16.0F;
    039            float var11 = var10 + 0.015609375F;
    040            float var12 = 0.1F * this.particleScale;
    041            float var13 = (float)(this.prevPosX + (this.posX - this.prevPosX) * (double)par2 - interpPosX);
    042            float var14 = (float)(this.prevPosY + (this.posY - this.prevPosY) * (double)par2 - interpPosY);
    043            float var15 = (float)(this.prevPosZ + (this.posZ - this.prevPosZ) * (double)par2 - interpPosZ);
    044            float var16 = 1.0F;
    045            par1Tessellator.setColorOpaque_F(var16 * this.particleRed, var16 * this.particleGreen, var16 * this.particleBlue);
    046            par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 - par5 * var12 - par7 * var12), (double)var8, (double)var11);
    047            par1Tessellator.addVertexWithUV((double)(var13 - par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 - par5 * var12 + par7 * var12), (double)var8, (double)var10);
    048            par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 + par6 * var12), (double)(var14 + par4 * var12), (double)(var15 + par5 * var12 + par7 * var12), (double)var9, (double)var10);
    049            par1Tessellator.addVertexWithUV((double)(var13 + par3 * var12 - par6 * var12), (double)(var14 - par4 * var12), (double)(var15 + par5 * var12 - par7 * var12), (double)var9, (double)var11);
    050        }
    051    }