Class NbtLongArray

java.lang.Object
net.minecraft.nbt.NbtLongArray
All Implemented Interfaces:
Iterable<NbtElement>, AbstractNbtList, NbtElement

public final class NbtLongArray extends Object implements AbstractNbtList
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
named net/minecraft/nbt/NbtLongArray
intermediary net/minecraft/class_2501
official uh
  • Field Details Link icon

    • SIZE Link icon

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

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

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

    • NbtLongArray Link icon

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

    • write Link icon

      public void write(DataOutput output) throws IOException
      Writes the NBT element to output.
      Specified by:
      write in interface NbtElement
      Throws:
      IOException
      API Note:
      This is a low-level method for serializing NBT elements; consider using NbtIo, NbtOps, or PacketByteBuf.writeNbt(net.minecraft.nbt.NbtElement) instead.
      Mappings:
      Namespace Name Mixin selector
      named write Lnet/minecraft/nbt/NbtElement;write(Ljava/io/DataOutput;)V
      intermediary method_10713 Lnet/minecraft/class_2520;method_10713(Ljava/io/DataOutput;)V
      official a Lva;a(Ljava/io/DataOutput;)V
    • getSizeInBytes Link icon

      public int getSizeInBytes()
      Specified by:
      getSizeInBytes in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named getSizeInBytes Lnet/minecraft/nbt/NbtElement;getSizeInBytes()I
      intermediary method_47988 Lnet/minecraft/class_2520;method_47988()I
      official a Lva;a()I
    • getType Link icon

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

      public NbtType<NbtLongArray> getNbtType()
      Returns the NBT type definition of this NBT element.
      Specified by:
      getNbtType in interface NbtElement
      Returns:
      the NBT type definition of this NBT element
      Mappings:
      Namespace Name Mixin selector
      named getNbtType Lnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;
      intermediary method_23258 Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;
      official c Lva;c()Lvc;
    • toString Link icon

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

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

      public boolean equals(Object o)
      Overrides:
      equals in class Object
      Mappings:
      Namespace Name Mixin selector
      named equals Lnet/minecraft/nbt/NbtLongArray;equals(Ljava/lang/Object;)Z
      intermediary equals Lnet/minecraft/class_2501;equals(Ljava/lang/Object;)Z
      official equals Luh;equals(Ljava/lang/Object;)Z
    • hashCode Link icon

      public int hashCode()
      Overrides:
      hashCode in class Object
    • accept Link icon

      public void accept(NbtElementVisitor visitor)
      Specified by:
      accept in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named accept Lnet/minecraft/nbt/NbtElement;accept(Lnet/minecraft/nbt/visitor/NbtElementVisitor;)V
      intermediary method_32289 Lnet/minecraft/class_2520;method_32289(Lnet/minecraft/class_5627;)V
      official a Lva;a(Lve;)V
    • getLongArray Link icon

      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
      named getLongArray Lnet/minecraft/nbt/NbtLongArray;getLongArray()[J
      intermediary method_10615 Lnet/minecraft/class_2501;method_10615()[J
      official g Luh;g()[J
    • size Link icon

      public int size()
      Specified by:
      size in interface AbstractNbtList
    • method_10534 Link icon

      public NbtLong method_10534(int int2)
      Mappings:
      Namespace Name Mixin selector
      named method_10534 Lnet/minecraft/nbt/NbtLongArray;method_10534(I)Lnet/minecraft/nbt/NbtLong;
      intermediary method_10616 Lnet/minecraft/class_2501;method_10616(I)Lnet/minecraft/class_2503;
      official a Luh;a(I)Lui;
    • setElement Link icon

      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 interface AbstractNbtList
      Returns:
      whether the element was actually set
      Mappings:
      Namespace Name Mixin selector
      named setElement Lnet/minecraft/nbt/AbstractNbtList;setElement(ILnet/minecraft/nbt/NbtElement;)Z
      intermediary method_10535 Lnet/minecraft/class_2483;method_10535(ILnet/minecraft/class_2520;)Z
      official a Ltz;a(ILva;)Z
    • addElement Link icon

      public boolean addElement(int index, NbtElement element)
      Inserts element at index. Does nothing if the types were incompatible.
      Specified by:
      addElement in interface AbstractNbtList
      Returns:
      whether the element was actually added
      Mappings:
      Namespace Name Mixin selector
      named addElement Lnet/minecraft/nbt/AbstractNbtList;addElement(ILnet/minecraft/nbt/NbtElement;)Z
      intermediary method_10533 Lnet/minecraft/class_2483;method_10533(ILnet/minecraft/class_2520;)Z
      official b Ltz;b(ILva;)Z
    • method_10536 Link icon

      public NbtLong method_10536(int int2)
      Mappings:
      Namespace Name Mixin selector
      named method_10536 Lnet/minecraft/nbt/NbtLongArray;method_10536(I)Lnet/minecraft/nbt/NbtLong;
      intermediary method_17811 Lnet/minecraft/class_2501;method_17811(I)Lnet/minecraft/class_2503;
      official b Luh;b(I)Lui;
    • clear Link icon

      public void clear()
      Specified by:
      clear in interface AbstractNbtList
    • asLongArray Link icon

      public Optional<long[]> asLongArray()
      Specified by:
      asLongArray in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named asLongArray Lnet/minecraft/nbt/NbtElement;asLongArray()Ljava/util/Optional;
      intermediary method_68593 Lnet/minecraft/class_2520;method_68593()Ljava/util/Optional;
      official r_ Lva;r_()Ljava/util/Optional;
    • doAccept Link icon

      public NbtScanner.Result doAccept(NbtScanner visitor)
      Specified by:
      doAccept in interface NbtElement
      Mappings:
      Namespace Name Mixin selector
      named doAccept Lnet/minecraft/nbt/NbtElement;doAccept(Lnet/minecraft/nbt/scanner/NbtScanner;)Lnet/minecraft/nbt/scanner/NbtScanner$Result;
      intermediary method_39850 Lnet/minecraft/class_2520;method_39850(Lnet/minecraft/class_6836;)Lnet/minecraft/class_6836$class_6838;
      official a Lva;a(Lux;)Lux$b;