    001    package net.minecraft.src;
    002
    003    public class EntityExpBottle extends EntityThrowable
    004    {
    005        public EntityExpBottle(World par1World)
    006        {
    007            super(par1World);
    008        }
    009
    010        public EntityExpBottle(World par1World, EntityLiving par2EntityLiving)
    011        {
    012            super(par1World, par2EntityLiving);
    013        }
    014
    015        public EntityExpBottle(World par1World, double par2, double par4, double par6)
    016        {
    017            super(par1World, par2, par4, par6);
    018        }
    019
    020        /**
    021         * Gets the amount of gravity to apply to the thrown entity with each tick.
    022         */
    023        protected float getGravityVelocity()
    024        {
    025            return 0.07F;
    026        }
    027
    028        protected float func_70182_d()
    029        {
    030            return 0.7F;
    031        }
    032
    033        protected float func_70183_g()
    034        {
    035            return -20.0F;
    036        }
    037
    038        /**
    039         * Called when this EntityThrowable hits a block or entity.
    040         */
    041        protected void onImpact(MovingObjectPosition par1MovingObjectPosition)
    042        {
    043            if (!this.worldObj.isRemote)
    044            {
    045                this.worldObj.playAuxSFX(2002, (int)Math.round(this.posX), (int)Math.round(this.posY), (int)Math.round(this.posZ), 0);
    046                int var2 = 3 + this.worldObj.rand.nextInt(5) + this.worldObj.rand.nextInt(5);
    047
    048                while (var2 > 0)
    049                {
    050                    int var3 = EntityXPOrb.getXPSplit(var2);
    051                    var2 -= var3;
    052                    this.worldObj.spawnEntityInWorld(new EntityXPOrb(this.worldObj, this.posX, this.posY, this.posZ, var3));
    053                }
    054
    055                this.setDead();
    056            }
    057        }
    058    }