Class LongArrayTag

java.lang.Object
com.viaversion.nbt.tag.LongArrayTag
All Implemented Interfaces:
NumberArrayTag, Tag

public final class LongArrayTag extends Object implements NumberArrayTag
A tag containing a long array.
  • Field Details

  • Constructor Details

    • LongArrayTag

      public LongArrayTag()
      Creates a tag.
    • LongArrayTag

      public LongArrayTag(long[] value)
      Creates a tag.
      Parameters:
      value - The value of the tag.
  • Method Details

    • read

      public static LongArrayTag read(DataInput in, TagLimiter tagLimiter) throws IOException
      Throws:
      IOException
    • getValue

      public long[] getValue()
      Description copied from interface: Tag
      Returns the value of this tag.
      Specified by:
      getValue in interface Tag
      Returns:
      value of this tag
    • asRawString

      public String asRawString()
      Description copied from interface: Tag
      Returns the raw string representation of the value of this tag. For SNBT, use SNBT.serialize(Tag).
      Specified by:
      asRawString in interface Tag
      Returns:
      raw string representation of the value of this tag
    • setValue

      public void setValue(long[] value)
      Sets the value of this tag.
      Parameters:
      value - New value of this tag.
    • get

      public long get(int index)
      Gets a value in this tag's array.
      Parameters:
      index - Index of the value.
      Returns:
      The value at the given index.
    • set

      public void set(int index, long value)
      Sets a value in this tag's array.
      Parameters:
      index - Index of the value.
      value - Value to set.
    • length

      public int length()
      Description copied from interface: NumberArrayTag
      Gets the length of this tag's array.
      Specified by:
      length in interface NumberArrayTag
      Returns:
      array length
    • toListTag

      public ListTag<LongTag> toListTag()
      Description copied from interface: NumberArrayTag
      Creates a new list tag from this tag.
      Specified by:
      toListTag in interface NumberArrayTag
      Returns:
      a new list tag
    • write

      public void write(DataOutput out) throws IOException
      Description copied from interface: Tag
      Writes this tag to an output stream.
      Specified by:
      write in interface Tag
      Parameters:
      out - data output to write to
      Throws:
      IOException - if an I/O error occurs
    • equals

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

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

      public LongArrayTag copy()
      Description copied from interface: Tag
      Returns a copy of this tag.
      Specified by:
      copy in interface NumberArrayTag
      Specified by:
      copy in interface Tag
      Returns:
      a copy of this tag
    • getTagId

      public int getTagId()
      Description copied from interface: Tag
      Returns the NBT tag id of this tag type, used in I/O.
      Specified by:
      getTagId in interface Tag
      Returns:
      ID of the tag this class represents
    • toString

      public String toString()
      Overrides:
      toString in class Object