public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Type"] = new TagNodeInt((int)_type);

            return tree;
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["EggLayTime"] = new TagNodeInt(_eggTime);

            return tree;
        }
Beispiel #3
0
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Size"] = new TagNodeInt(_size);

            return tree;
        }
        public override TagNode BuildTree ()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["Profession"] = new TagNodeInt(_profession);

            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["Age"] = new TagNodeInt(_age);
            tree["InLove"] = new TagNodeInt(_inLove);

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

            if (_record != null) {
                tree["Record"] = new TagNodeInt((int)_record);
            }

            return tree;
        }
        private void WriteInt(TagNodeInt val)
        {
            byte[] gzBytes = BitConverter.GetBytes(val.Data);

            if (BitConverter.IsLittleEndian)
            {
                Array.Reverse(gzBytes);
            }

            _stream.Write(gzBytes, 0, 4);
        }
        private TagNode ReadInt()
        {
            byte[] gzBytes = new byte[4];
            _stream.Read(gzBytes, 0, 4);

            if (BitConverter.IsLittleEndian)
            {
                Array.Reverse(gzBytes);
            }

            TagNodeInt val = new TagNodeInt(BitConverter.ToInt32(gzBytes, 0));

            return(val);
        }
        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;
        }
        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;
            }
        }
Beispiel #12
0
 public TagIntDataNode(TagNodeInt tag)
     : base(tag)
 {
 }
        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["Levels"] = new TagNodeInt(_levels);
            tree["Primary"] = new TagNodeInt(_primary);
            tree["Secondary"] = new TagNodeInt(_secondary);

            return tree;
        }
Beispiel #15
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["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;
        }
        public override TagNode BuildTree()
        {
            TagNodeCompound tree = base.BuildTree() as TagNodeCompound;
            tree["EntityId"] = new TagNodeString(_entityID);
            tree["Delay"] = new TagNodeShort(_delay);

            if (_maxDelay != null)
                tree["MaxSpawnDelay"] = new TagNodeShort(_maxDelay ?? 0);
            if (_minDelay != null)
                tree["MinSpawnDelay"] = new TagNodeShort(_minDelay ?? 0);
            if (_spawnCount != null)
                tree["SpawnCount"] = new TagNodeShort(_spawnCount ?? 0);
            if (_spawnRange != null)
                tree["SpawnRange"] = new TagNodeShort(_spawnRange ?? 0);
            if (_maxNearbyEnemies != null)
                tree["MaxNearbyEnemies"] = new TagNodeShort(_maxNearbyEnemies ?? 0);
            if (_requiredPlayerRange != null)
                tree["RequiredPlayerRange"] = new TagNodeShort(_requiredPlayerRange ?? 0);
            if (_maxExperience != null)
                tree["MaxExperience"] = new TagNodeInt(_maxExperience ?? 0);
            if (_remainingExperience != null)
                tree["RemainingExperience"] = new TagNodeInt(_remainingExperience ?? 0);
            if (_experienceRegenTick != null)
                tree["ExperienceRegenTick"] = new TagNodeInt(_experienceRegenTick ?? 0);
            if (_experienceRegenRate != null)
                tree["ExperienceRegenRate"] = new TagNodeInt(_experienceRegenRate ?? 0);
            if (_experienceRegenAmount != null)
                tree["ExperienceRegenAmount"] = new TagNodeInt(_experienceRegenAmount ?? 0);

            if (_spawnData != null && _spawnData.Count > 0)
                tree["SpawnData"] = _spawnData;

            return tree;
        }
        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;
        }