    001    package net.minecraft.src;
    002
    003    public class ItemSeedFood extends ItemFood
    004    {
    005        private int field_82808_b;
    006        private int field_82809_c;
    007
    008        public ItemSeedFood(int par1, int par2, float par3, int par4, int par5)
    009        {
    010            super(par1, par2, par3, false);
    011            this.field_82808_b = par4;
    012            this.field_82809_c = par5;
    013        }
    014
    015        /**
    016         * Callback for item usage. If the item does something special on right clicking, he will have one of those. Return
    017         * True if something happen and false if it don't. This is for ITEMS, not BLOCKS
    018         */
    019        public boolean onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, int par4, int par5, int par6, int par7, float par8, float par9, float par10)
    020        {
    021            if (par7 != 1)
    022            {
    023                return false;
    024            }
    025            else if (par2EntityPlayer.func_82247_a(par4, par5, par6, par7, par1ItemStack) && par2EntityPlayer.func_82247_a(par4, par5 + 1, par6, par7, par1ItemStack))
    026            {
    027                int var11 = par3World.getBlockId(par4, par5, par6);
    028
    029                if (var11 == this.field_82809_c && par3World.isAirBlock(par4, par5 + 1, par6))
    030                {
    031                    par3World.setBlockWithNotify(par4, par5 + 1, par6, this.field_82808_b);
    032                    --par1ItemStack.stackSize;
    033                    return true;
    034                }
    035                else
    036                {
    037                    return false;
    038                }
    039            }
    040            else
    041            {
    042                return false;
    043            }
    044        }
    045    }