public virtual bool AddItemStackToInventory(net.minecraft.src.ItemStack itemstack
                                                    )
        {
            if (!itemstack.IsItemDamaged())
            {
                int i;
                do
                {
                    i = itemstack.stackSize;
                    itemstack.stackSize = Func_21083_d(itemstack);
                }while (itemstack.stackSize > 0 && itemstack.stackSize < i);
                return(itemstack.stackSize < i);
            }
            int j = GetFirstEmptyStack();

            if (j >= 0)
            {
                mainInventory[j] = net.minecraft.src.ItemStack.CloneStack(itemstack);
                mainInventory[j].animationsToGo = 5;
                itemstack.stackSize             = 0;
                return(true);
            }
            else
            {
                return(false);
            }
        }