    001    package net.minecraft.src;
    002
    003    import net.minecraft.server.MinecraftServer;
    004
    005    public class BehaviorBucketFullDispense extends BehaviorDefaultDispenseItem
    006    {
    007        /** Reference to the BehaviorDefaultDispenseItem object. */
    008        private final BehaviorDefaultDispenseItem defaultItemDispenseBehavior;
    009
    010        /** Reference to the MinecraftServer object. */
    011        final MinecraftServer mcServer;
    012
    013        public BehaviorBucketFullDispense(MinecraftServer par1)
    014        {
    015            this.mcServer = par1;
    016            this.defaultItemDispenseBehavior = new BehaviorDefaultDispenseItem();
    017        }
    018
    019        /**
    020         * Dispense the specified stack, play the dispense sound and spawn particles.
    021         */
    022        public ItemStack dispenseStack(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
    023        {
    024            ItemBucket var3 = (ItemBucket)par2ItemStack.getItem();
    025            int var4 = par1IBlockSource.getXInt();
    026            int var5 = par1IBlockSource.getYInt();
    027            int var6 = par1IBlockSource.getZInt();
    028            EnumFacing var7 = EnumFacing.func_82600_a(par1IBlockSource.func_82620_h());
    029
    030            if (var3.tryPlaceContainedLiquid(par1IBlockSource.getWorld(), (double)var4, (double)var5, (double)var6, var4 + var7.func_82601_c(), var5, var6 + var7.func_82599_e()))
    031            {
    032                par2ItemStack.itemID = Item.bucketEmpty.shiftedIndex;
    033                par2ItemStack.stackSize = 1;
    034                return par2ItemStack;
    035            }
    036            else
    037            {
    038                return this.defaultItemDispenseBehavior.dispense(par1IBlockSource, par2ItemStack);
    039            }
    040        }
    041    }