public bool InsertTag(TagNode tag, int index) { if (index < 0 || index > _tag.Count) { return(false); } _tag.Insert(index, tag); return(true); }
public bool InsertTag(TagNode tag, int index) { if (index < 0 || index > _tag.Count) { return(false); } if (_tag.ValueType != tag.GetTagType()) { return(false); } _tag.Insert(index, tag); SetModified(); return(true); }
public static void SaveData(TagNodeList Inventory) { Inventory.Clear(); Inventory.ChangeValueType(TagType.TAG_COMPOUND); int count = 0; for (int i = 0; i < 36; i++) { InventoryItem item = items[i]; if (item.id != null) { TagNodeCompound serializeItem = new TagNodeCompound(); serializeItem.Add("Count", (TagNodeByte)item.count); serializeItem.Add("Damage", (TagNodeShort)item.damage); serializeItem.Add("id", (TagNodeString)item.id); serializeItem.Add("Slot", (TagNodeByte)i); Inventory.Insert(count, serializeItem); } } }