Beispiel #1
0
        public NbtCompound GetTree()
        {
            INbtNode node = NodeFactory.CreateNode(NbtType.Compound);

            node.Load(this, null);
            return((NbtCompound)node);
        }
Beispiel #2
0
        public override void Load(NbtReader reader, INbtContainerNode parent)
        {
            base.Load(reader, parent);
            var listType = reader.ReadType();
            int length   = reader.ReadInt32();

            for (int i = 0; i < length; i++)
            {
                INbtNode node = NodeFactory.CreateNode(listType);
                node.Load(reader, this);
                Children.Add(node);
            }
        }
Beispiel #3
0
 public override void Load(NbtReader reader, INbtContainerNode parent)
 {
     base.Load(reader, parent);
     while (true)
     {
         var listType = reader.PeekType();
         if (listType == NbtType.End)
         {
             break;
         }
         INbtNode node = NodeFactory.CreateNode(listType);
         node.Load(reader, this);
         Children.Add(node);
     }
 }