Class NbtLongArray

All Implemented Interfaces:
Iterable<NbtLong>, Collection<NbtLong>, List<NbtLong>, NbtElement

public class NbtLongArray extends AbstractNbtList<NbtLong>
Represents an NBT 64-bit integer array. This object is mutable and backed by long[]. Its type is 0xc. Like Java arrays, accessing indices that are out of bounds will throw ArrayIndexOutOfBoundsException. The backing array can be obtained via getLongArray().
Mappings:
Namespace Name
official su
intermediary net/minecraft/class_2501
named net/minecraft/nbt/NbtLongArray
  • Field Details

    • SIZE

      private static final int SIZE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lsu;b:I
      intermediary field_41726 Lnet/minecraft/class_2501;field_41726:I
      named SIZE Lnet/minecraft/nbt/NbtLongArray;SIZE:I
    • TYPE

      public static final NbtType<NbtLongArray> TYPE
      Mappings:
      Namespace Name Mixin selector
      official a Lsu;a:Ltm;
      intermediary field_21040 Lnet/minecraft/class_2501;field_21040:Lnet/minecraft/class_4614;
      named TYPE Lnet/minecraft/nbt/NbtLongArray;TYPE:Lnet/minecraft/nbt/NbtType;
    • value

      private long[] value
      Mappings:
      Namespace Name Mixin selector
      official c Lsu;c:[J
      intermediary field_11552 Lnet/minecraft/class_2501;field_11552:[J
      named value Lnet/minecraft/nbt/NbtLongArray;value:[J
  • Constructor Details

    • NbtLongArray

      public NbtLongArray(long[] value)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lsu;<init>([J)V
      intermediary <init> Lnet/minecraft/class_2501;<init>([J)V
      named <init> Lnet/minecraft/nbt/NbtLongArray;<init>([J)V
    • NbtLongArray

      public NbtLongArray(LongSet value)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lsu;<init>(Lit/unimi/dsi/fastutil/longs/LongSet;)V
      intermediary <init> Lnet/minecraft/class_2501;<init>(Lit/unimi/dsi/fastutil/longs/LongSet;)V
      named <init> Lnet/minecraft/nbt/NbtLongArray;<init>(Lit/unimi/dsi/fastutil/longs/LongSet;)V
    • NbtLongArray

      public NbtLongArray(List<Long> value)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lsu;<init>(Ljava/util/List;)V
      intermediary <init> Lnet/minecraft/class_2501;<init>(Ljava/util/List;)V
      named <init> Lnet/minecraft/nbt/NbtLongArray;<init>(Ljava/util/List;)V
  • Method Details

    • toArray

      private static long[] toArray(List<Long> list)
      Mappings:
      Namespace Name Mixin selector
      official a Lsu;a(Ljava/util/List;)[J
      intermediary method_10617 Lnet/minecraft/class_2501;method_10617(Ljava/util/List;)[J
      named toArray Lnet/minecraft/nbt/NbtLongArray;toArray(Ljava/util/List;)[J
    • write

      public void write(DataOutput output) throws IOException
      Writes the NBT element to output.
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      official a Ltk;a(Ljava/io/DataOutput;)V
      intermediary method_10713 Lnet/minecraft/class_2520;method_10713(Ljava/io/DataOutput;)V
      named write Lnet/minecraft/nbt/NbtElement;write(Ljava/io/DataOutput;)V
    • getSizeInBytes

      public int getSizeInBytes()
      Mappings:
      Namespace Name Mixin selector
      official a Ltk;a()I
      intermediary method_47988 Lnet/minecraft/class_2520;method_47988()I
      named getSizeInBytes Lnet/minecraft/nbt/NbtElement;getSizeInBytes()I
    • getType

      public byte getType()
      Returns the type of this NBT element.
      Returns:
      the type of this NBT element
      Mappings:
      Namespace Name Mixin selector
      official b Ltk;b()B
      intermediary method_10711 Lnet/minecraft/class_2520;method_10711()B
      named getType Lnet/minecraft/nbt/NbtElement;getType()B
    • getNbtType

      public NbtType<NbtLongArray> getNbtType()
      Returns the NBT type definition of this NBT element.
      Returns:
      the NBT type definition of this NBT element
      Mappings:
      Namespace Name Mixin selector
      official c Ltk;c()Ltm;
      intermediary method_23258 Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;
      named getNbtType Lnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;
    • toString

      public String toString()
      Specified by:
      toString in interface NbtElement
      Overrides:
      toString in class AbstractCollection<NbtLong>
    • copy

      public NbtLongArray copy()
      Description copied from interface: NbtElement
      Returns an NBT element of equal value that won't change with this element.
      Returns:
      an NBT element of equal value that won't change with this element
      Mappings:
      Namespace Name Mixin selector
      official e Lsu;e()Lsu;
      intermediary method_10618 Lnet/minecraft/class_2501;method_10618()Lnet/minecraft/class_2501;
      named copy Lnet/minecraft/nbt/NbtLongArray;copy()Lnet/minecraft/nbt/NbtLongArray;
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Collection<NbtLong>
      Specified by:
      equals in interface List<NbtLong>
      Overrides:
      equals in class AbstractList<NbtLong>
      Mappings:
      Namespace Name Mixin selector
      official equals Lsu;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_2501;equals(Ljava/lang/Object;)Z
      named equals Lnet/minecraft/nbt/NbtLongArray;equals(Ljava/lang/Object;)Z
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Collection<NbtLong>
      Specified by:
      hashCode in interface List<NbtLong>
      Overrides:
      hashCode in class AbstractList<NbtLong>
    • accept

      public void accept(NbtElementVisitor visitor)
      Mappings:
      Namespace Name Mixin selector
      official a Ltk;a(Lto;)V
      intermediary method_32289 Lnet/minecraft/class_2520;method_32289(Lnet/minecraft/class_5627;)V
      named accept Lnet/minecraft/nbt/NbtElement;accept(Lnet/minecraft/nbt/visitor/NbtElementVisitor;)V
    • getLongArray

      public long[] getLongArray()
      Returns the underlying long array.
      Returns:
      the underlying long array
      API Note:
      This does not copy the array, so modifications to the returned array also apply to this NBT long array.
      Mappings:
      Namespace Name Mixin selector
      official g Lsu;g()[J
      intermediary method_10615 Lnet/minecraft/class_2501;method_10615()[J
      named getLongArray Lnet/minecraft/nbt/NbtLongArray;getLongArray()[J
    • size

      public int size()
      Specified by:
      size in interface Collection<NbtLong>
      Specified by:
      size in interface List<NbtLong>
      Specified by:
      size in class AbstractCollection<NbtLong>
    • get

      public NbtLong get(int int2)
      Specified by:
      get in interface List<NbtLong>
      Specified by:
      get in class AbstractList<NbtLong>
      Mappings:
      Namespace Name Mixin selector
      official a Lsu;a(I)Lsv;
      intermediary method_10616 Lnet/minecraft/class_2501;method_10616(I)Lnet/minecraft/class_2503;
      named get Lnet/minecraft/nbt/NbtLongArray;get(I)Lnet/minecraft/nbt/NbtLong;
    • method_10606

      public NbtLong method_10606(int int2, NbtLong nbtLong)
      Mappings:
      Namespace Name Mixin selector
      official a Lsu;a(ILsv;)Lsv;
      intermediary method_17810 Lnet/minecraft/class_2501;method_17810(ILnet/minecraft/class_2503;)Lnet/minecraft/class_2503;
      named method_10606 Lnet/minecraft/nbt/NbtLongArray;method_10606(ILnet/minecraft/nbt/NbtLong;)Lnet/minecraft/nbt/NbtLong;
    • add

      public void add(int int2, NbtLong nbtLong)
      Specified by:
      add in interface List<NbtLong>
      Specified by:
      add in class AbstractNbtList<NbtLong>
      Mappings:
      Namespace Name Mixin selector
      official b Lsu;b(ILsv;)V
      intermediary method_17812 Lnet/minecraft/class_2501;method_17812(ILnet/minecraft/class_2503;)V
      named add Lnet/minecraft/nbt/NbtLongArray;add(ILnet/minecraft/nbt/NbtLong;)V
    • setElement

      public boolean setElement(int index, NbtElement element)
      Sets the element at index to element. Does nothing if the types were incompatible.
      Specified by:
      setElement in class AbstractNbtList<NbtLong>
      Returns:
      whether the element was actually set
      Mappings:
      Namespace Name Mixin selector
      official a Lsm;a(ILtk;)Z
      intermediary method_10535 Lnet/minecraft/class_2483;method_10535(ILnet/minecraft/class_2520;)Z
      named setElement Lnet/minecraft/nbt/AbstractNbtList;setElement(ILnet/minecraft/nbt/NbtElement;)Z
    • addElement

      public boolean addElement(int index, NbtElement element)
      Inserts element at index. Does nothing if the types were incompatible.
      Specified by:
      addElement in class AbstractNbtList<NbtLong>
      Returns:
      whether the element was actually added
      Mappings:
      Namespace Name Mixin selector
      official b Lsm;b(ILtk;)Z
      intermediary method_10533 Lnet/minecraft/class_2483;method_10533(ILnet/minecraft/class_2520;)Z
      named addElement Lnet/minecraft/nbt/AbstractNbtList;addElement(ILnet/minecraft/nbt/NbtElement;)Z
    • remove

      public NbtLong remove(int int2)
      Specified by:
      remove in interface List<NbtLong>
      Specified by:
      remove in class AbstractNbtList<NbtLong>
      Mappings:
      Namespace Name Mixin selector
      official b Lsu;b(I)Lsv;
      intermediary method_17811 Lnet/minecraft/class_2501;method_17811(I)Lnet/minecraft/class_2503;
      named remove Lnet/minecraft/nbt/NbtLongArray;remove(I)Lnet/minecraft/nbt/NbtLong;
    • getHeldType

      public byte getHeldType()
      Gets the type of element that this list holds.
      Specified by:
      getHeldType in class AbstractNbtList<NbtLong>
      Returns:
      the type of element that this list holds
      Mappings:
      Namespace Name Mixin selector
      official f Lsm;f()B
      intermediary method_10601 Lnet/minecraft/class_2483;method_10601()B
      named getHeldType Lnet/minecraft/nbt/AbstractNbtList;getHeldType()B
    • clear

      public void clear()
      Specified by:
      clear in interface Collection<NbtLong>
      Specified by:
      clear in interface List<NbtLong>
      Overrides:
      clear in class AbstractList<NbtLong>
    • doAccept

      public NbtScanner.Result doAccept(NbtScanner visitor)
      Mappings:
      Namespace Name Mixin selector
      official a Ltk;a(Lth;)Lth$b;
      intermediary method_39850 Lnet/minecraft/class_2520;method_39850(Lnet/minecraft/class_6836;)Lnet/minecraft/class_6836$class_6838;
      named doAccept Lnet/minecraft/nbt/NbtElement;doAccept(Lnet/minecraft/nbt/scanner/NbtScanner;)Lnet/minecraft/nbt/scanner/NbtScanner$Result;