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