    001    package net.minecraft.src;
    002
    003    import net.minecraft.server.MinecraftServer;
    004
    005    public class BehaviorMobEggDispense extends BehaviorDefaultDispenseItem
    006    {
    007        /** Reference to the MinecraftServer object. */
    008        final MinecraftServer mcServer;
    009
    010        public BehaviorMobEggDispense(MinecraftServer par1)
    011        {
    012            this.mcServer = par1;
    013        }
    014
    015        /**
    016         * Dispense the specified stack, play the dispense sound and spawn particles.
    017         */
    018        public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
    019        {
    020            EnumFacing var3 = EnumFacing.func_82600_a(par1IBlockSource.func_82620_h());
    021            double var4 = par1IBlockSource.getX() + (double)var3.func_82601_c();
    022            double var6 = (double)((float)par1IBlockSource.getYInt() + 0.2F);
    023            double var8 = par1IBlockSource.getZ() + (double)var3.func_82599_e();
    024            ItemMonsterPlacer.spawnCreature(par1IBlockSource.getWorld(), par2ItemStack.getItemDamage(), var4, var6, var8);
    025            par2ItemStack.splitStack(1);
    026            return par2ItemStack;
    027        }
    028
    029        /**
    030         * Play the dispense sound from the specified block.
    031         */
    032        protected void playDispenseSound(IBlockSource par1IBlockSource)
    033        {
    034            par1IBlockSource.getWorld().playAuxSFX(1002, par1IBlockSource.getXInt(), par1IBlockSource.getYInt(), par1IBlockSource.getZInt(), 0);
    035        }
    036    }