Class NbtReader
Namespace: Void.Minecraft.Nbt
Assembly: Void.Minecraft.dll
Reads binary NBT while preserving empty compound keys and supporting unnamed roots.
public class NbtReader : TagReader, IDisposableInheritance
object ← TagIO ← TagReader ← NbtReader
Implements
Inherited Members
TagReader.TagRead, TagReader.TagEncountered, TagReader.ReadByte(bool), TagReader.ReadShort(bool), TagReader.ReadInt(bool), TagReader.ReadLong(bool), TagReader.ReadFloat(bool), TagReader.ReadDouble(bool), TagReader.ReadString(bool), TagReader.ReadByteArray(bool), TagReader.ReadIntArray(bool), TagReader.ReadLongArray(bool), TagReader.ReadList(bool), TagReader.ReadCompound(bool), TagReader.ReadTag(bool), TagReader.ReadTagAsync(bool), TagReader.ReadTag<T>(bool), TagReader.ReadTagAsync<T>(bool), TagReader.ReadUTF8String(), TagReader.ReadToFixSizedBuffer(Span<byte>), TagReader.ReadToFixSizedBuffer(byte[], int, int), TagReader.Dispose(), TagReader.DisposeAsync(), TagReader.OnTagRead(Tag), TagReader.OnTagEncountered(TagType, bool), TagIO.BaseStream, TagIO.SwapEndian, TagIO.UseVarInt, TagIO.ZigZagEncoding, TagIO.FormatOptions, TagIO.Dispose(), TagIO.DisposeAsync(), object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Constructors
NbtReader(Stream, FormatOptions, bool)
Reads binary NBT while preserving empty compound keys and supporting unnamed roots.
public NbtReader(Stream stream, FormatOptions options, bool leaveOpen = false)Parameters
stream Stream
The source stream.
options FormatOptions
The binary NBT encoding options.
leaveOpen bool
Whether to leave stream open when the reader is disposed.
Methods
ReadCompound(bool)
Reads a compound payload through its terminating end tag.
public CompoundTag ReadCompound(bool named = true)Parameters
named bool
Whether to read the compound’s name before its payload.
Returns
The compound, including children with empty names preserved as empty strings.
ReadList(bool)
Reads a homogeneous list payload.
public ListTag ReadList(bool named = true)Parameters
named bool
Whether to read the list’s name before its payload.
Returns
The parsed list.
Exceptions
A non-empty list declares
ReadTag(bool)
Reads a tag type identifier followed by its optional name and payload.
public Tag ReadTag(bool named = true)Parameters
named bool
Whether the tag includes a name field.
Returns
The parsed tag.