Enum Class NbtType

java.lang.Object
java.lang.Enum<NbtType>
com.comphenix.protocol.wrappers.nbt.NbtType
All Implemented Interfaces:
Serializable, Comparable<NbtType>, Constable

public enum NbtType extends Enum<NbtType>
Represents all the element types
  • Enum Constant Details

    • TAG_END

      public static final NbtType TAG_END
      Used to mark the end of compound tags. CANNOT be constructed.
    • TAG_BYTE

      public static final NbtType TAG_BYTE
      A signed 1 byte integral type. Sometimes used for booleans.
    • TAG_SHORT

      public static final NbtType TAG_SHORT
      A signed 2 byte integral type.
    • TAG_INT

      public static final NbtType TAG_INT
      A signed 4 byte integral type.
    • TAG_LONG

      public static final NbtType TAG_LONG
      A signed 8 byte integral type.
    • TAG_FLOAT

      public static final NbtType TAG_FLOAT
      A signed 4 byte floating point type.
    • TAG_DOUBLE

      public static final NbtType TAG_DOUBLE
      A signed 8 byte floating point type.
    • TAG_BYTE_ARRAY

      public static final NbtType TAG_BYTE_ARRAY
      An array of bytes.
    • TAG_INT_ARRAY

      public static final NbtType TAG_INT_ARRAY
      An array of TAG_Int's payloads..
    • TAG_STRING

      public static final NbtType TAG_STRING
      A UTF-8 string
    • TAG_LIST

      public static final NbtType TAG_LIST
      A list of tag payloads, without repeated tag IDs or any tag names.
    • TAG_COMPOUND

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

      public static final NbtType TAG_LONG_ARRAY
      An array of longs
  • Method Details

    • values

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

      public Class<?> getValueType()
      Retrieves the type of the value stored in the NBT element.
      Returns:
      Type of the stored value.
    • getTypeFromID

      public static NbtType getTypeFromID(int rawID)
      Retrieve an NBT type from a given raw ID.
      Parameters:
      rawID - - the raw ID to lookup.
      Returns:
      The associated NBT value.
    • getTypeFromClass

      public static NbtType getTypeFromClass(Class<?> clazz)
      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.