    001    package net.minecraft.src;
    002
    003    public class EntitySnowball extends EntityThrowable
    004    {
    005        public EntitySnowball(World par1World)
    006        {
    007            super(par1World);
    008        }
    009
    010        public EntitySnowball(World par1World, EntityLiving par2EntityLiving)
    011        {
    012            super(par1World, par2EntityLiving);
    013        }
    014
    015        public EntitySnowball(World par1World, double par2, double par4, double par6)
    016        {
    017            super(par1World, par2, par4, par6);
    018        }
    019
    020        /**
    021         * Called when this EntityThrowable hits a block or entity.
    022         */
    023        protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
    024        {
    025            if (par1MovingObjectPosition.entityHit != null)
    026            {
    027                byte var2 = 0;
    028
    029                if (par1MovingObjectPosition.entityHit instanceof EntityBlaze)
    030                {
    031                    var2 = 3;
    032                }
    033
    034                par1MovingObjectPosition.entityHit.attackEntityFrom(DamageSource.causeThrownDamage(this, this.func_85052_h()), var2);
    035            }
    036
    037            for (int var3 = 0; var3 < 8; ++var3)
    038            {
    039                this.worldObj.spawnParticle("snowballpoof", this.posX, this.posY, this.posZ, 0.0D, 0.0D, 0.0D);
    040            }
    041
    042            if (!this.worldObj.isRemote)
    043            {
    044                this.setDead();
    045            }
    046        }
    047    }