Class NbtIntArray

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

public class NbtIntArray extends AbstractNbtList<NbtInt>
Represents an NBT 32-bit integer array. This object is mutable and backed by int[]. Its type is 0xb. Like Java arrays, accessing indices that are out of bounds will throw ArrayIndexOutOfBoundsException. The backing array can be obtained via getIntArray().
Mappings:
Namespace Name
official qv
intermediary net/minecraft/class_2495
named net/minecraft/nbt/NbtIntArray
  • Field Details

    • SIZE

      private static final int SIZE
      See Also:
      Mappings:
      Namespace Name Mixin selector
      official b Lqv;b:I
      intermediary field_41723 Lnet/minecraft/class_2495;field_41723:I
      named SIZE Lnet/minecraft/nbt/NbtIntArray;SIZE:I
    • TYPE

      public static final NbtType<NbtIntArray> TYPE
      Mappings:
      Namespace Name Mixin selector
      official a Lqv;a:Lrm;
      intermediary field_21036 Lnet/minecraft/class_2495;field_21036:Lnet/minecraft/class_4614;
      named TYPE Lnet/minecraft/nbt/NbtIntArray;TYPE:Lnet/minecraft/nbt/NbtType;
    • value

      private int[] value
      Mappings:
      Namespace Name Mixin selector
      official c Lqv;c:[I
      intermediary field_11524 Lnet/minecraft/class_2495;field_11524:[I
      named value Lnet/minecraft/nbt/NbtIntArray;value:[I
  • Constructor Details

    • NbtIntArray

      public NbtIntArray(int[] value)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lqv;<init>([I)V
      intermediary <init> Lnet/minecraft/class_2495;<init>([I)V
      named <init> Lnet/minecraft/nbt/NbtIntArray;<init>([I)V
    • NbtIntArray

      public NbtIntArray(List<Integer> value)
      Mappings:
      Namespace Name Mixin selector
      official <init> Lqv;<init>(Ljava/util/List;)V
      intermediary <init> Lnet/minecraft/class_2495;<init>(Ljava/util/List;)V
      named <init> Lnet/minecraft/nbt/NbtIntArray;<init>(Ljava/util/List;)V
  • Method Details

    • toArray

      private static int[] toArray(List<Integer> list)
      Mappings:
      Namespace Name Mixin selector
      official a Lqv;a(Ljava/util/List;)[I
      intermediary method_10590 Lnet/minecraft/class_2495;method_10590(Ljava/util/List;)[I
      named toArray Lnet/minecraft/nbt/NbtIntArray;toArray(Ljava/util/List;)[I
    • write

      public void write(DataOutput output) throws IOException
      Writes the NBT element to output.
      Throws:
      IOException
      Mappings:
      Namespace Name Mixin selector
      official a Lrk;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 Lrk;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 Lrk;b()B
      intermediary method_10711 Lnet/minecraft/class_2520;method_10711()B
      named getType Lnet/minecraft/nbt/NbtElement;getType()B
    • getNbtType

      public NbtType<NbtIntArray> 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 Lrk;c()Lrm;
      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<NbtInt>
    • copy

      public NbtIntArray 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 Lqv;e()Lqv;
      intermediary method_10591 Lnet/minecraft/class_2495;method_10591()Lnet/minecraft/class_2495;
      named copy Lnet/minecraft/nbt/NbtIntArray;copy()Lnet/minecraft/nbt/NbtIntArray;
    • equals

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

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

      public int[] getIntArray()
      Returns the underlying int array.
      Returns:
      the underlying int array
      API Note:
      This does not copy the array, so modifications to the returned array also apply to this NBT int array.
      Mappings:
      Namespace Name Mixin selector
      official g Lqv;g()[I
      intermediary method_10588 Lnet/minecraft/class_2495;method_10588()[I
      named getIntArray Lnet/minecraft/nbt/NbtIntArray;getIntArray()[I
    • accept

      public void accept(NbtElementVisitor visitor)
      Mappings:
      Namespace Name Mixin selector
      official a Lrk;a(Lro;)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
    • size

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

      public NbtInt get(int int2)
      Specified by:
      get in interface List<NbtInt>
      Specified by:
      get in class AbstractList<NbtInt>
      Mappings:
      Namespace Name Mixin selector
      official a Lqv;a(I)Lqw;
      intermediary method_10589 Lnet/minecraft/class_2495;method_10589(I)Lnet/minecraft/class_2497;
      named get Lnet/minecraft/nbt/NbtIntArray;get(I)Lnet/minecraft/nbt/NbtInt;
    • set

      public NbtInt set(int int2, NbtInt nbtInt)
      Specified by:
      set in interface List<NbtInt>
      Specified by:
      set in class AbstractNbtList<NbtInt>
      Mappings:
      Namespace Name Mixin selector
      official a Lqv;a(ILqw;)Lqw;
      intermediary method_17806 Lnet/minecraft/class_2495;method_17806(ILnet/minecraft/class_2497;)Lnet/minecraft/class_2497;
      named set Lnet/minecraft/nbt/NbtIntArray;set(ILnet/minecraft/nbt/NbtInt;)Lnet/minecraft/nbt/NbtInt;
    • add

      public void add(int int2, NbtInt nbtInt)
      Specified by:
      add in interface List<NbtInt>
      Specified by:
      add in class AbstractNbtList<NbtInt>
      Mappings:
      Namespace Name Mixin selector
      official b Lqv;b(ILqw;)V
      intermediary method_17808 Lnet/minecraft/class_2495;method_17808(ILnet/minecraft/class_2497;)V
      named add Lnet/minecraft/nbt/NbtIntArray;add(ILnet/minecraft/nbt/NbtInt;)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<NbtInt>
      Returns:
      whether the element was actually set
      Mappings:
      Namespace Name Mixin selector
      official a Lqq;a(ILrk;)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<NbtInt>
      Returns:
      whether the element was actually added
      Mappings:
      Namespace Name Mixin selector
      official b Lqq;b(ILrk;)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 NbtInt remove(int int2)
      Specified by:
      remove in interface List<NbtInt>
      Specified by:
      remove in class AbstractNbtList<NbtInt>
      Mappings:
      Namespace Name Mixin selector
      official b Lqv;b(I)Lqw;
      intermediary method_17807 Lnet/minecraft/class_2495;method_17807(I)Lnet/minecraft/class_2497;
      named remove Lnet/minecraft/nbt/NbtIntArray;remove(I)Lnet/minecraft/nbt/NbtInt;
    • getHeldType

      public byte getHeldType()
      Gets the type of element that this list holds.
      Specified by:
      getHeldType in class AbstractNbtList<NbtInt>
      Returns:
      the type of element that this list holds
      Mappings:
      Namespace Name Mixin selector
      official f Lqq;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<NbtInt>
      Specified by:
      clear in interface List<NbtInt>
      Overrides:
      clear in class AbstractList<NbtInt>
    • doAccept

      public NbtScanner.Result doAccept(NbtScanner visitor)
      Mappings:
      Namespace Name Mixin selector
      official a Lrk;a(Lrh;)Lrh$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;