Esempio n. 1
0
        /// <summary>
        /// compares ItemStack argument to the instance ItemStack; returns true if both ItemStacks are equal
        /// </summary>
        private bool IsItemStackEqual(ItemStack par1ItemStack)
        {
            if (StackSize != par1ItemStack.StackSize)
            {
                return(false);
            }

            if (ItemID != par1ItemStack.ItemID)
            {
                return(false);
            }

            if (ItemDamage != par1ItemStack.ItemDamage)
            {
                return(false);
            }

            if (StackTagCompound == null && par1ItemStack.StackTagCompound != null)
            {
                return(false);
            }

            return(StackTagCompound == null || StackTagCompound.Equals(par1ItemStack.StackTagCompound));
        }