Пример #1
0
        public Item RemoveEnchantment(Enchantment enchantment)
        {
            CompoundTag tag = this.NamedTag;

            if (!tag.Exist("ench"))
            {
                return(this);
            }
            ListTag list = tag.GetList("ench");

            for (int i = 0; i < list.Count; ++i)
            {
                if (((CompoundTag)list[i]).GetShort("id") == enchantment.ID)
                {
                    list.RemoveAt(i);
                }
            }
            this.NamedTag = tag;
            return(this);
        }