    001package net.minecraft.dispenser;
    002
    003import net.minecraft.item.ItemMonsterPlacer;
    004import net.minecraft.item.ItemStack;
    005import net.minecraft.server.MinecraftServer;
    006import net.minecraft.util.EnumFacing;
    007
    008public class BehaviorMobEggDispense extends BehaviorDefaultDispenseItem
    009{
    010    /** Reference to the MinecraftServer object. */
    011    final MinecraftServer mcServer;
    012
    013    public BehaviorMobEggDispense(MinecraftServer par1)
    014    {
    015        this.mcServer = par1;
    016    }
    017
    018    /**
    019     * Dispense the specified stack, play the dispense sound and spawn particles.
    020     */
    021    public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
    022    {
    023        EnumFacing var3 = EnumFacing.getFront(par1IBlockSource.func_82620_h());
    024        double var4 = par1IBlockSource.getX() + (double)var3.getFrontOffsetX();
    025        double var6 = (double)((float)par1IBlockSource.getYInt() + 0.2F);
    026        double var8 = par1IBlockSource.getZ() + (double)var3.getFrontOffsetZ();
    027        ItemMonsterPlacer.spawnCreature(par1IBlockSource.getWorld(), par2ItemStack.getItemDamage(), var4, var6, var8);
    028        par2ItemStack.splitStack(1);
    029        return par2ItemStack;
    030    }
    031}