Module syntaxnbt

Enum Class TagType

java.lang.Object
java.lang.Enum<TagType>
at.syntaxerror.syntaxnbt.tag.TagType
All Implemented Interfaces:
Serializable, Comparable<TagType>, Constable

public enum TagType extends Enum<TagType>
This enum contains all valid types of NBT tags.
Information according to wiki.vg
Author:
SyntaxError404
  • Enum Constant Details

    • END

      public static final TagType 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

      public static final TagType BYTE
      A single signed byte
    • SHORT

      public static final TagType SHORT
      A single signed, big endian 16 bit integer
    • INT

      public static final TagType INT
      A single signed, big endian 32 bit integer
    • LONG

      public static final TagType LONG
      A single signed, big endian 64 bit integer
    • FLOAT

      public static final TagType FLOAT
      A single, big endian IEEE-754 single-precision floating point number (NaN possible)
    • DOUBLE

      public static final TagType DOUBLE
      A single, big endian IEEE-754 double-precision floating point number (NaN possible)
    • BYTE_ARRAY

      public static final TagType BYTE_ARRAY
      A length-prefixed array of signed bytes. The prefix is a signed integer (thus 4 bytes)
    • STRING

      public static final TagType 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

      public static final TagType LIST
      A list of nameless tags, all of the same type. The list is prefixed with the Type ID of 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

      public static final TagType COMPOUND
      Effectively a list of a named tags. Order is not guaranteed.
    • INT_ARRAY

      public static final TagType 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

      public static final TagType 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

      public static TagType[] 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

      public static TagType valueOf(String name)
      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 name
      NullPointerException - if the argument is null
    • getTypeFromClass

      public static TagType getTypeFromClass(Class<?> clazz)
      Converts a class into its corresponding tag type
      Parameters:
      clazz - a class
      Returns:
      the corresponding type
    • getTypeFromId

      public static TagType getTypeFromId(int id)
      Converts an ID into its corresponding tag type
      Parameters:
      id - an ID
      Returns:
      the corresponding type
    • toString

      public String toString()
      Overrides:
      toString in class Enum<TagType>
    • getId

      public int getId()
      Returns the ID for this type
      Returns:
      the ID for this type
    • getName

      public String getName()
      Returns the name for this type
      Returns:
      the name for this type
    • getTagClass

      public Class<?> getTagClass()
      Returns the implementation class for this type
      Returns:
      the implementation class for this type