NbtTag class Null safety

Represents the base of any NBT Tag.

Implementers

Constructors

NbtTag(String name, NbtTagType _nbtTagType)
Create a basic NbtTag with given nbtTagType. This shouldn't be used directly and please refer to implementations for all other nbt tags.

Properties

hashCode int
The hash code for this object. [...]
read-only, override
hasLength bool
If the tag is a List and has a length
read-only
hasValue bool
If this tag directly has a value.
read-only
name String
The name of this tag. Inside of Lists or Arrays, this is 'None'.
read / write
nbtTagType NbtTagType
The type of this tag.
read-only
parent NbtTag?
The parent of this tag. Can only be null for the root NbtCompound.
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value → dynamic
The value of this tag. Can vary depending on tag type, obtainable from nbtTagType.
read-only

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
readTag(NbtReader nbtReader, {bool withName = true}) NbtTag
Reads a NbtTag from fileReader. If the parent is a NbtList or NbtArray, withName should be set to false to avoid reading the name of this Tag.
toString() String
A string representation of this object. [...]
override
writeTag(NbtWriter nbtWriter, {bool withName = true, bool withType = true}) → void
Writes a NbtTag from fileReader. If the parent is a NbtList or NbtArray, withName should be set to false to avoid writing any names of this Tag.

Operators

operator ==(Object o) bool
The equality operator. [...]
override

Static Methods

readNewTag(NbtReader fileReader, NbtTag? parent, {bool withName = true}) NbtTag?
Reads the next byte from the file and returns the parsed NbtTag corresponding to the read tag type.
readTagForType(NbtReader nbtReader, int tagType, {NbtTag? parent, bool withName = true}) NbtTag?
Reads the Tag with type tagType. If inside a NbtList or NbtArray, withName should be set to false to avoid reading the name of this Tag.