Enum Class NbtType
- All Implemented Interfaces:
Serializable,Comparable<NbtType>,Constable
Represents all the element types
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA signed 1 byte integral type.An array of bytes.A list of fully formed tags, including their IDs, names, and payloads.A signed 8 byte floating point type.Used to mark the end of compound tags.A signed 4 byte floating point type.A signed 4 byte integral type.An array of TAG_Int's payloads..A list of tag payloads, without repeated tag IDs or any tag names.A signed 8 byte integral type.An array of longsA signed 2 byte integral type.A UTF-8 string -
Method Summary
Modifier and TypeMethodDescriptionintgetRawID()Retrieves the raw unique integer that identifies the type of the parent NBT element.static NbtTypegetTypeFromClass(Class<?> clazz) Retrieve an NBT type from the given Java class.static NbtTypegetTypeFromID(int rawID) Retrieve an NBT type from a given raw ID.Class<?> Retrieves the type of the value stored in the NBT element.booleanDetermine if the given NBT can store multiple children NBT tags.static NbtTypeReturns the enum constant of this class with the specified name.static NbtType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
TAG_END
Used to mark the end of compound tags. CANNOT be constructed. -
TAG_BYTE
A signed 1 byte integral type. Sometimes used for booleans. -
TAG_SHORT
A signed 2 byte integral type. -
TAG_INT
A signed 4 byte integral type. -
TAG_LONG
A signed 8 byte integral type. -
TAG_FLOAT
A signed 4 byte floating point type. -
TAG_DOUBLE
A signed 8 byte floating point type. -
TAG_BYTE_ARRAY
An array of bytes. -
TAG_INT_ARRAY
An array of TAG_Int's payloads.. -
TAG_STRING
A UTF-8 string -
TAG_LIST
A list of tag payloads, without repeated tag IDs or any tag names. -
TAG_COMPOUND
A list of fully formed tags, including their IDs, names, and payloads. No two tags may have the same name. -
TAG_LONG_ARRAY
An array of longs
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException- if this enum class has no constant with the specified nameNullPointerException- if the argument is null
-
isComposite
public boolean isComposite()Determine if the given NBT can store multiple children NBT tags.- Returns:
- TRUE if this is a composite NBT tag, FALSE otherwise.
-
getRawID
public int getRawID()Retrieves the raw unique integer that identifies the type of the parent NBT element.- Returns:
- Integer that uniquely identifying the type.
-
getValueType
Retrieves the type of the value stored in the NBT element.- Returns:
- Type of the stored value.
-
getTypeFromID
Retrieve an NBT type from a given raw ID.- Parameters:
rawID- - the raw ID to lookup.- Returns:
- The associated NBT value.
-
getTypeFromClass
Retrieve an NBT type from the given Java class.- Parameters:
clazz- - type of the value the NBT type can contain.- Returns:
- The NBT type.
- Throws:
IllegalArgumentException- If this class type cannot be represented by NBT tags.
-