Class NbtByte

All Implemented Interfaces:
NbtElement

public class NbtByte
extends AbstractNbtNumber
Represents an NBT byte.
  • Field Details

    • TYPE

      public static final NbtType<NbtByte> TYPE
    • ZERO

      public static final NbtByte ZERO
    • ONE

      public static final NbtByte ONE
    • value

      private final byte value
  • Constructor Details

    • NbtByte

      private NbtByte​(byte value)
  • Method Details

    • of

      public static NbtByte of​(byte value)
    • of

      public static NbtByte of​(boolean value)
    • write

      public void write​(DataOutput output) throws IOException
      Throws:
      IOException
    • getType

      public byte getType()
      Gets the type of this NBT element.
      Returns:
      the type
    • getNbtType

      public NbtType<NbtByte> getNbtType()
      Gets the NBT type definition of this NBT element.
      Returns:
      the element type definition
    • toString

      public String toString()
      Specified by:
      toString in interface NbtElement
      Overrides:
      toString in class Object
    • copy

      public NbtByte copy()
      Description copied from interface: NbtElement
      Copies this NBT element.
      Returns:
      the copied element
    • equals

      public boolean equals​(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toText

      public Text toText​(String indent, int depth)
    • longValue

      public long longValue()
      Gets the value as a 64-bit integer.
      Specified by:
      longValue in class AbstractNbtNumber
      Returns:
      the value as a long
    • intValue

      public int intValue()
      Gets the value as a 32-bit integer.
      Specified by:
      intValue in class AbstractNbtNumber
      Returns:
      the value as an int
    • shortValue

      public short shortValue()
      Gets the value as a 16-bit integer.
      Specified by:
      shortValue in class AbstractNbtNumber
      Returns:
      the value as a short
    • byteValue

      public byte byteValue()
      Gets the value as an 8-bit integer.
      Specified by:
      byteValue in class AbstractNbtNumber
      Returns:
      the value as a byte
    • doubleValue

      public double doubleValue()
      Gets the value as a 64-bit floating-point number.
      Specified by:
      doubleValue in class AbstractNbtNumber
      Returns:
      the value as a double
    • floatValue

      public float floatValue()
      Gets the value as a 32-bit floating-point number.
      Specified by:
      floatValue in class AbstractNbtNumber
      Returns:
      the value as a float
    • numberValue

      public Number numberValue()
      Gets the value as a generic number.
      Specified by:
      numberValue in class AbstractNbtNumber
      Returns:
      the value as a Number