Ejemplo n.º 1
0
 internal override void Write(PrimitiveWriter writer)
 {
     foreach (var pair in Value)
     {
         writer.WriteByte(pair.Value.ID);
         writer.WriteStringNbt(pair.Key);
         pair.Value.Write(writer);
     }
     writer.WriteByte(EndId);
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Writes an Uncompressed NbtBlob.
        /// </summary>
        /// <exception cref="NBTException">Invalid Nbt.</exception>
        public static void WriteNbtBlob(this PrimitiveWriter writer, NbtBlob blob)
        {
            if (blob.IsEmpty)
            {
                writer.WriteByte(Tag.EndId);
                return;
            }

            writer.WriteByte(blob.Root.ID);
            writer.WriteStringNbt(blob.Name);
            blob.Root.Write(writer);
        }
Ejemplo n.º 3
0
 internal override void Write(PrimitiveWriter writer) => writer.WriteStringNbt(Value);