    001package net.minecraft.dispenser;
    002
    003import net.minecraft.item.ItemPotion;
    004import net.minecraft.item.ItemStack;
    005import net.minecraft.server.MinecraftServer;
    006
    007public class BehaviorPotionDispense implements IBehaviorDispenseItem
    008{
    009    /** Reference to the BehaviorDefaultDispenseItem object. */
    010    private final BehaviorDefaultDispenseItem defaultItemDispenseBehavior;
    011
    012    /** Reference to the MinecraftServer object. */
    013    final MinecraftServer mcServer;
    014
    015    public BehaviorPotionDispense(MinecraftServer par1)
    016    {
    017        this.mcServer = par1;
    018        this.defaultItemDispenseBehavior = new BehaviorDefaultDispenseItem();
    019    }
    020
    021    /**
    022     * Dispenses the specified ItemStack from a dispenser.
    023     */
    024    public ItemStack dispense(IBlockSource par1IBlockSource, ItemStack par2ItemStack)
    025    {
    026        return ItemPotion.isSplash(par2ItemStack.getItemDamage()) ? (new BehaviorPotionDispenseLogic(this, par2ItemStack)).dispense(par1IBlockSource, par2ItemStack) : this.defaultItemDispenseBehavior.dispense(par1IBlockSource, par2ItemStack);
    027    }
    028}