- All Implemented Interfaces:
Serializable,Comparable<TagType>,Constable
This enum contains all valid types of NBT tags.
Information according to wiki.vg
Information according to wiki.vg
- Author:
- SyntaxError404
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>> -
Enum Constant Summary
Enum ConstantsEnum ConstantDescriptionA single signed byteA length-prefixed array of signed bytes.Effectively a list of a named tags.Signifies the end of a TAG_Compound.A single signed, big endian 32 bit integerA length-prefixed array of signed integers.A list of nameless tags, all of the same type.A single signed, big endian 64 bit integerA length-prefixed array of signed longs.A single signed, big endian 16 bit integerA length-prefixed modified UTF-8 string. -
Method Summary
Modifier and TypeMethodDescriptionintgetId()Returns the ID for this typegetName()Returns the name for this typeClass<?>Returns the implementation class for this typestatic TagTypegetTypeFromClass(Class<?> clazz) Converts aclassinto its corresponding tag typestatic TagTypegetTypeFromId(int id) Converts anIDinto its corresponding tag typetoString()static TagTypeReturns the enum constant of this class with the specified name.static TagType[]values()Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
END
Signifies the end of a TAG_Compound. It is only ever used inside a TAG_Compound, and is not named despite being in a TAG_Compound -
BYTE
A single signed byte -
SHORT
A single signed, big endian 16 bit integer -
INT
A single signed, big endian 32 bit integer -
LONG
A single signed, big endian 64 bit integer -
FLOAT
-
DOUBLE
-
BYTE_ARRAY
A length-prefixed array of signed bytes. The prefix is a signed integer (thus 4 bytes) -
STRING
A length-prefixed modified UTF-8 string. The prefix is an unsigned short (thus 2 bytes) signifying the length of the string in bytes -
LIST
A list of nameless tags, all of the same type. The list is prefixed with theType IDof the items it contains (thus 1 byte), and the length of the list as a signed integer (a further 4 bytes). If the length of the list is 0 or negative, the type may be 0 (TAG_End) but otherwise it must be any other type. (The notchian implementation uses TAG_End in that situation, but another reference implementation by Mojang uses 1 instead; parsers should accept any type if the length is <= 0). -
COMPOUND
Effectively a list of a named tags. Order is not guaranteed. -
INT_ARRAY
A length-prefixed array of signed integers. The prefix is a signed integer (thus 4 bytes) and indicates the number of 4 byte integers. -
LONG_ARRAY
A length-prefixed array of signed longs. The prefix is a signed integer (thus 4 bytes) and indicates the number of 8 byte 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
-
getTypeFromClass
Converts aclassinto its corresponding tag type- Parameters:
clazz- a class- Returns:
- the corresponding type
-
getTypeFromId
Converts anIDinto its corresponding tag type- Parameters:
id- an ID- Returns:
- the corresponding type
-
toString
-
getId
public int getId()Returns the ID for this type- Returns:
- the ID for this type
-
getName
Returns the name for this type- Returns:
- the name for this type
-
getTagClass
Returns the implementation class for this type- Returns:
- the implementation class for this type
-