private void WriteNbtTag (StreamWriter writer, TagNode tag) { if (tag == null) return; writer.Write(JSONSerializer.Serialize(tag)); }
public static string GetTagNodeText(TagNode tag) { if (tag == null) return null; switch (tag.GetTagType()) { case TagType.TAG_BYTE: case TagType.TAG_SHORT: case TagType.TAG_INT: case TagType.TAG_LONG: case TagType.TAG_FLOAT: case TagType.TAG_DOUBLE: case TagType.TAG_STRING: return tag.ToString(); case TagType.TAG_BYTE_ARRAY: return tag.ToTagByteArray().Length + " bytes"; case TagType.TAG_LIST: return tag.ToTagList().Count + " entries"; case TagType.TAG_COMPOUND: return tag.ToTagCompound().Count + " entries"; } return null; }
public bool DeleteTag(TagNode tag) { foreach (String name in _tag.Keys) if (_tag[name] == tag) return _tag.Remove(name); return false; }
public bool AddTag(TagNode tag, string name) { if (_tag.ContainsKey(name)) return false; _tag.Add(name, tag); return true; }
public bool DeleteTag (TagNode tag) { bool result = _tag.Remove(tag); if (result) SetModified(); return result; }
public bool InsertTag(TagNode tag, int index) { if (index < 0 || index > _tag.Count) return false; _tag.Insert(index, tag); return true; }
public string GetTagName(TagNode tag) { foreach (String name in _tag.Keys) if (_tag[name] == tag) return name; return null; }
public override TypedEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } return this; }
public bool AppendTag (TagNode tag) { if (_tag.ValueType != tag.GetTagType()) return false; _tag.Add(tag); SetModified(); return true; }
private void Apply() { if (ValidateInput()) { _tag = CreateTag(); DialogResult = DialogResult.OK; Close(); return; } }
public override TypedEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _tile = ctree["Tile"].ToTagByte(); return this; }
public override TileEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _command = ctree["Command"].ToTagString(); return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _profession = ctree["Profession"].ToTagInt(); return this; }
public override EntityTyped LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _size = ctree["Size"].ToTagInt(); return this; }
public bool RenameTag(TagNode tag, string name) { if (_tag.ContainsKey(name)) return false; string oldName = GetTagName(tag); _tag.Remove(oldName); _tag.Add(name, tag); return true; }
public override TypedEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _anger = ctree["Anger"].ToTagShort(); return this; }
public override EntityTyped LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _saddle = ctree["Saddle"].ToTagByte() == 1; return this; }
public override TypedEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _eggTime = ctree["EggLayTime"].ToTagInt(); return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _type = ctree["RabbitType"].ToTagByte(); _carrots = ctree["MoreCarrotTicks"].ToTagByte(); return this; }
internal static ItemInfo TryGetItemName(TagNode tag) { var tagc = tag as TagNodeCompound; if (tagc.ContainsKey("id") == false) return null; int id; if (int.TryParse(tagc["id"].ToString(), out id)) { return TryGetItemName(id); } return null; }
public override TileEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } TagNodeList items = ctree["Items"].ToTagList(); _items = new ItemCollection(_CAPACITY).LoadTree(items); return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } TagNodeList items = ctree["Items"].ToTagList(); _items = _items.LoadTree(items); return this; }
public override TileEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _delay = ctree["Delay"].ToTagShort(); _entityID = ctree["EntityId"].ToTagString(); return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _carried = ctree["carried"].ToTagShort(); _carryingData = ctree["carriedData"].ToTagShort(); return this; }
public override TypedEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _inData = ctree["inData"].ToTagByte(); _player = ctree["player"].ToTagByte(); return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _sheared = ctree["Sheared"].ToTagByte() == 1; _color = ctree["Color"].ToTagByte(); return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _life = ctree["Lifetime"].ToTagInt(); _player = ctree["PlayerSpawned"].ToTagByte() == 1; return this; }
public override TypedEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _age = ctree["Age"].ToTagInt(); _inLove = ctree["InLove"].ToTagInt(); return this; }
public override TileEntity LoadTree(TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } if (ctree.ContainsKey("Record")) { _record = ctree["Record"].ToTagInt(); } return this; }
public override TypedEntity LoadTree (TagNode tree) { TagNodeCompound ctree = tree as TagNodeCompound; if (ctree == null || base.LoadTree(tree) == null) { return null; } _owner = ctree["Owner"].ToTagString(); _sitting = ctree["Sitting"].ToTagByte() == 1; _angry = ctree["Angry"].ToTagByte() == 1; return this; }
public override bool ValidateTree(TagNode tree) { return(new NbtVerifier(tree, MonsterSchema).Verify()); }
public TagScalarFormData(TagNode tag) { Tag = tag; }
protected Container(TagNode tag) : base(tag) { }
protected TagDataNode(TagNode tag) { _tag = tag; }
public virtual bool DeleteTag(TagNode tag) { return(false); }
/// <inheritdoc/> public bool ValidateTree(TagNode tree) { return(new NbtVerifier(tree, _schema).Verify()); }