Class NbtTagNumberAdapter
Namespace: Void.Minecraft.Nbt.Serializers.Json.Adapter
Assembly: Void.Minecraft.dll
Selects and aligns NBT numeric types for untyped JSON numbers.
public class NbtTagNumberAdapterInheritance
Inherited Members
object.Equals(object?), object.Equals(object?, object?), object.GetHashCode(), object.GetType(), object.MemberwiseClone(), object.ReferenceEquals(object?, object?), object.ToString()
Methods
AlignNumbers(List<NbtTag>)
Promotes numeric tags in a list to the widest numeric
public static void AlignNumbers(List<NbtTag> tags)Parameters
The list whose numeric entries should be aligned before validating the list element type.
Remarks
This method mutates tags in place by replacing narrower numeric tags with new tags of the target type.
Non-numeric tags are left unchanged.
Exceptions
Thrown when tags is null.
Thrown when tags is empty.
DeserializeNumber(ref Utf8JsonReader)
Reads the current JSON number into the narrowest supported NBT numeric type.
public static NbtTag DeserializeNumber(ref Utf8JsonReader reader)Parameters
reader Utf8JsonReader
The reader positioned on a number.
Returns
An NBT byte, short, integer, long, float, or double tag.
Exceptions
The token cannot be represented by an NBT numeric type.
GetTagsType(List<NbtTag>)
Gets the single common type of all tags in a list.
public static NbtTagType GetTagsType(List<NbtTag> tags)Parameters
The tags to inspect.
Returns
The common tag type.
Exceptions
The list is empty or contains multiple tag types.