public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Elder"] = new TagNodeByte((byte)(_elder ? 1 : 0));

            return tree;
        }
Beispiel #2
0
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Saddle"] = new TagNodeByte((byte)(_saddle ? 1 : 0));

            return tree;
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Tile"] = new TagNodeByte(_tile);

            return tree;
        }
Beispiel #4
0
        public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Sheared"] = new TagNodeByte((byte)(_sheared ? 1 : 0));
            tree["Color"] = new TagNodeByte(_color);

            return tree;
        }
        public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Lifetime"] = new TagNodeInt(_life);
            tree["PlayerSpawned"] = new TagNodeByte((byte)((_player) ? 1 : 0));

            return tree;
        }
Beispiel #6
0
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Owner"] = new TagNodeString(_owner);
            tree["Sitting"] = new TagNodeByte((byte)(_sitting ? 1 : 0));
            tree["Angry"] = new TagNodeByte((byte)(_angry ? 1 : 0));

            return tree;
        }
        public override TagNode BuildTree ()
        {

            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["MoreCarrotTicks"] = new TagNodeByte(_carrots);
            tree["RabbitType"] = new TagNodeByte(_type);

            return tree;
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;

            if (_powered != null) {
                tree["powered"] = new TagNodeByte((byte)((_powered ?? false) ? 1 : 0));
            }

            return tree;
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;

            if (_flag != null)
            {
                tree["BatFlags"] = new TagNodeByte((byte)((_flag) ? 1 : 0));
            }

            return tree;
        }
        private TagNode ReadByte()
        {
            int gzByte = _stream.ReadByte();

            if (gzByte == -1)
            {
                throw new NBTException(NBTException.MSG_GZIP_ENDOFSTREAM);
            }

            TagNodeByte val = new TagNodeByte((byte)gzByte);

            return(val);
        }
        public override TagNode BuildTree ()
        {

            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Saddle"] = new TagNodeByte((byte)(_sadle ? 1 : 0));
            tree["Tame"] = new TagNodeByte((byte)(_tamed ? 1 : 0));
            tree["Bred"] = new TagNodeByte((byte)(_bred ? 1 : 0));
            tree["Type"] = new TagNodeByte(_type);
            tree["Variant"] = new TagNodeInt(_variant);

            tree["ChestedHorse"] = new TagNodeByte((byte)(_chested ? 1 : 0));
            tree["HasReproduced"] = new TagNodeByte((byte)(_reproduced ? 1 : 0));
            tree["Temper"] = new TagNodeByte(_temper);

            return tree;
        }
        public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Peek"] = new TagNodeByte(_peek);
            tree["AttachFace"] = new TagNodeByte(_attachFace);

            tree["APX"] = new TagNodeInt(_apx);
            tree["APY"] = new TagNodeInt(_apy);
            tree["APY"] = new TagNodeInt(_apz);
            return tree;
        }
 private void WriteByte(TagNodeByte val)
 {
     _stream.WriteByte(val.Data);
 }
        internal static void AddTagToNode(TreeNode node, int descriptionIndex, TagType type)
        {
            TagNode tag = GetTagNode(node);
            if (tag == null)
                return;

            if (tag.GetTagType() != TagType.TAG_COMPOUND &&
                tag.GetTagType() != TagType.TAG_LIST)
                return;

            if (tag.GetTagType() == TagType.TAG_LIST &&
                tag.ToTagList().ValueType != type &&
                tag.ToTagList().Count > 0)
                return;

            TagNode newNode = null;
            switch (type)
            {
                case TagType.TAG_BYTE:
                    newNode = new TagNodeByte();
                    break;
                case TagType.TAG_SHORT:
                    newNode = new TagNodeShort();
                    break;
                case TagType.TAG_INT:
                    newNode = new TagNodeInt();
                    break;
                case TagType.TAG_LONG:
                    newNode = new TagNodeLong();
                    break;
                case TagType.TAG_FLOAT:
                    newNode = new TagNodeFloat();
                    break;
                case TagType.TAG_DOUBLE:
                    newNode = new TagNodeDouble();
                    break;
                case TagType.TAG_BYTE_ARRAY:
                    newNode = new TagNodeByteArray();
                    break;
                case TagType.TAG_STRING:
                    newNode = new TagNodeString();
                    break;
                case TagType.TAG_LIST:
                    newNode = new TagNodeList(TagType.TAG_BYTE);
                    break;
                case TagType.TAG_COMPOUND:
                    newNode = new TagNodeCompound();
                    break;
                case TagType.TAG_INT_ARRAY:
                    newNode = new TagNodeIntArray();
                    break;
            }

            if (tag is TagNodeCompound)
            {
                TagNodeCompound ctag = tag as TagNodeCompound;

                EditValue form = new EditValue("");
                foreach (string key in ctag.Keys)
                {
                    form.InvalidNames.Add(key);
                }

                if (form.ShowDialog() != DialogResult.OK)
                    return;

                ctag.Add(form.NodeName, newNode);

                TreeNode tnode = NodeFromTag(newNode, descriptionIndex, form.NodeName);
                node.Nodes.Add(tnode);

                tnode.TreeView.SelectedNode = tnode;
                tnode.Expand();
            }
            else if (tag is TagNodeList)
            {
                var ltag = tag as TagNodeList;
                if (ltag.ValueType != type)
                    ltag.ChangeValueType(type);

                ltag.Add(newNode);

                TreeNode tnode = NodeFromTag(newNode, descriptionIndex);
                node.Nodes.Add(tnode);
                tnode.TreeView.SelectedNode = tnode;

                tnode.Expand();
            }

            node.Text = GetNodeText(node);

            TreeNode baseNode = BaseNode(node);
            if (baseNode != null)
            {
                (baseNode.Tag as DataNode).Modified = true;
            }
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;

            if (_record != null) {
                tree["blockId"] = new TagNodeInt(_blockId);
                tree["blockData"] = new TagNodeInt(_blockData);
                tree["facing"] = new TagNodeInt(_facing);
                tree["progress"] = new TagNodeFloat(_progress);
                tree["extending"] = new TagNodeByte(_extending);
            }

            return tree;
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["xTile"] = new TagNodeShort(_xTile);
            tree["yTile"] = new TagNodeShort(_yTile);
            tree["zTile"] = new TagNodeShort(_zTile);
            tree["inTile"] = new TagNodeByte(_inTile);
            tree["shake"] = new TagNodeByte(_shake);
            tree["inGround"] = new TagNodeByte(_inGround);

            return tree;
        }
Beispiel #17
0
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["AttackTime"] = new TagNodeShort(_attackTime);
            tree["DeathTime"] = new TagNodeShort(_deathTime);
            tree["Health"] = new TagNodeShort(_health);
            tree["HurtTime"] = new TagNodeShort(_hurtTime);

            if (_activeEffects != null) {
                TagNodeCompound ae = new TagNodeCompound();
                ae["Id"] = new TagNodeByte((byte)_activeEffects.Id);
                ae["Amplifier"] = new TagNodeByte((byte)_activeEffects.Amplifier);
                ae["Duration"] = new TagNodeInt(_activeEffects.Duration);

                tree["ActiveEffects"] = ae;
            }

            return tree;
        }
        public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Dir"] = new TagNodeByte((byte)_dir);
            tree["Motive"] = new TagNodeString(_motive);
            tree["TileX"] = new TagNodeInt(_xTile);
            tree["TileY"] = new TagNodeInt(_yTile);
            tree["TileZ"] = new TagNodeInt(_zTile);

            return tree;
        }
        public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Anger"] = new TagNodeShort(_anger);

            tree["IsVillager"] = new TagNodeByte((byte)((_villager ) ? 1 : 0));
            tree["IsBaby"] = new TagNodeByte((byte)((_baby) ? 1 : 0));
            tree["CanBreakDoors"] = new TagNodeByte((byte)((_breakDoors) ? 1 : 0));
            return tree;
        }
Beispiel #20
0
 public TagByteDataNode(TagNodeByte tag)
     : base(tag)
 {
 }