Package net.minecraft.nbt
Class NbtLongArray
java.lang.Object
net.minecraft.nbt.NbtLongArray
- All Implemented Interfaces:
Iterable<NbtElement>,AbstractNbtList,NbtElement
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/NbtLongArrayintermediary net/minecraft/class_2501official uh
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final intstatic final NbtType<NbtLongArray> private long[]Fields inherited from interface net.minecraft.nbt.NbtElement
BYTE_ARRAY_TYPE, BYTE_TYPE, COMPOUND_TYPE, DOUBLE_TYPE, END_TYPE, field_33246, field_33247, field_33248, field_33249, FLOAT_TYPE, INT_ARRAY_TYPE, INT_TYPE, LIST_TYPE, LONG_ARRAY_TYPE, LONG_TYPE, MAX_DEPTH, SHORT_TYPE, STRING_TYPE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaccept(NbtElementVisitor visitor) booleanaddElement(int index, NbtElement element) Insertselementatindex.Optional<long[]> voidclear()copy()Returns an NBT element of equal value that won't change with this element.doAccept(NbtScanner visitor) booleanlong[]Returns the underlying long array.Returns the NBT type definition of this NBT element.intbytegetType()Returns the type of this NBT element.inthashCode()method_10534(int int2) method_10536(int int2) booleansetElement(int index, NbtElement element) Sets the element atindextoelement.intsize()toString()voidwrite(DataOutput output) Writes the NBT element tooutput.Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.nbt.AbstractNbtList
get, isEmpty, iterator, remove, streamMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.nbt.NbtElement
accept, asBoolean, asByte, asByteArray, asCompound, asDouble, asFloat, asInt, asIntArray, asLong, asNbtList, asNumber, asShort, asString
-
Field Details
-
SIZE
private static final int SIZE- See Also:
- Mappings:
Namespace Name Mixin selector named SIZELnet/minecraft/nbt/NbtLongArray;SIZE:Iintermediary field_41726Lnet/minecraft/class_2501;field_41726:Iofficial bLuh;b:I
-
TYPE
- Mappings:
Namespace Name Mixin selector named TYPELnet/minecraft/nbt/NbtLongArray;TYPE:Lnet/minecraft/nbt/NbtType;intermediary field_21040Lnet/minecraft/class_2501;field_21040:Lnet/minecraft/class_4614;official aLuh;a:Lvc;
-
value
private long[] value- Mappings:
Namespace Name Mixin selector named valueLnet/minecraft/nbt/NbtLongArray;value:[Jintermediary field_11552Lnet/minecraft/class_2501;field_11552:[Jofficial cLuh;c:[J
-
-
Constructor Details
-
NbtLongArray
public NbtLongArray(long[] value) - Mappings:
Namespace Name Mixin selector named <init>Lnet/minecraft/nbt/NbtLongArray;<init>([J)Vintermediary <init>Lnet/minecraft/class_2501;<init>([J)Vofficial <init>Luh;<init>([J)V
-
-
Method Details
-
write
Writes the NBT element tooutput.- Specified by:
writein interfaceNbtElement- Throws:
IOException- API Note:
- This is a low-level method for serializing NBT elements; consider using
NbtIo,NbtOps, orPacketByteBuf.writeNbt(net.minecraft.nbt.NbtElement)instead. - Mappings:
Namespace Name Mixin selector named writeLnet/minecraft/nbt/NbtElement;write(Ljava/io/DataOutput;)Vintermediary method_10713Lnet/minecraft/class_2520;method_10713(Ljava/io/DataOutput;)Vofficial aLva;a(Ljava/io/DataOutput;)V
-
getSizeInBytes
public int getSizeInBytes()- Specified by:
getSizeInBytesin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named getSizeInBytesLnet/minecraft/nbt/NbtElement;getSizeInBytes()Iintermediary method_47988Lnet/minecraft/class_2520;method_47988()Iofficial aLva;a()I
-
getType
public byte getType()Returns the type of this NBT element.- Specified by:
getTypein interfaceNbtElement- Returns:
- the type of this NBT element
- Mappings:
Namespace Name Mixin selector named getTypeLnet/minecraft/nbt/NbtElement;getType()Bintermediary method_10711Lnet/minecraft/class_2520;method_10711()Bofficial bLva;b()B
-
getNbtType
Returns the NBT type definition of this NBT element.- Specified by:
getNbtTypein interfaceNbtElement- Returns:
- the NBT type definition of this NBT element
- Mappings:
Namespace Name Mixin selector named getNbtTypeLnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;intermediary method_23258Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;official cLva;c()Lvc;
-
toString
- Specified by:
toStringin interfaceNbtElement- Overrides:
toStringin classObject
-
copy
Description copied from interface:NbtElementReturns an NBT element of equal value that won't change with this element.- Specified by:
copyin interfaceNbtElement- Returns:
- an NBT element of equal value that won't change with this element
- Mappings:
Namespace Name Mixin selector named copyLnet/minecraft/nbt/NbtLongArray;copy()Lnet/minecraft/nbt/NbtLongArray;intermediary method_10618Lnet/minecraft/class_2501;method_10618()Lnet/minecraft/class_2501;official eLuh;e()Luh;
-
equals
-
hashCode
public int hashCode() -
accept
- Specified by:
acceptin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named acceptLnet/minecraft/nbt/NbtElement;accept(Lnet/minecraft/nbt/visitor/NbtElementVisitor;)Vintermediary method_32289Lnet/minecraft/class_2520;method_32289(Lnet/minecraft/class_5627;)Vofficial aLva;a(Lve;)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 named getLongArrayLnet/minecraft/nbt/NbtLongArray;getLongArray()[Jintermediary method_10615Lnet/minecraft/class_2501;method_10615()[Jofficial gLuh;g()[J
-
size
public int size()- Specified by:
sizein interfaceAbstractNbtList
-
method_10534
- Mappings:
Namespace Name Mixin selector named method_10534Lnet/minecraft/nbt/NbtLongArray;method_10534(I)Lnet/minecraft/nbt/NbtLong;intermediary method_10616Lnet/minecraft/class_2501;method_10616(I)Lnet/minecraft/class_2503;official aLuh;a(I)Lui;
-
setElement
Sets the element atindextoelement. Does nothing if the types were incompatible.- Specified by:
setElementin interfaceAbstractNbtList- Returns:
- whether the element was actually set
- Mappings:
Namespace Name Mixin selector named setElementLnet/minecraft/nbt/AbstractNbtList;setElement(ILnet/minecraft/nbt/NbtElement;)Zintermediary method_10535Lnet/minecraft/class_2483;method_10535(ILnet/minecraft/class_2520;)Zofficial aLtz;a(ILva;)Z
-
addElement
Insertselementatindex. Does nothing if the types were incompatible.- Specified by:
addElementin interfaceAbstractNbtList- Returns:
- whether the element was actually added
- Mappings:
Namespace Name Mixin selector named addElementLnet/minecraft/nbt/AbstractNbtList;addElement(ILnet/minecraft/nbt/NbtElement;)Zintermediary method_10533Lnet/minecraft/class_2483;method_10533(ILnet/minecraft/class_2520;)Zofficial bLtz;b(ILva;)Z
-
method_10536
- Mappings:
Namespace Name Mixin selector named method_10536Lnet/minecraft/nbt/NbtLongArray;method_10536(I)Lnet/minecraft/nbt/NbtLong;intermediary method_17811Lnet/minecraft/class_2501;method_17811(I)Lnet/minecraft/class_2503;official bLuh;b(I)Lui;
-
clear
public void clear()- Specified by:
clearin interfaceAbstractNbtList
-
asLongArray
- Specified by:
asLongArrayin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named asLongArrayLnet/minecraft/nbt/NbtElement;asLongArray()Ljava/util/Optional;intermediary method_68593Lnet/minecraft/class_2520;method_68593()Ljava/util/Optional;official r_Lva;r_()Ljava/util/Optional;
-
doAccept
- Specified by:
doAcceptin interfaceNbtElement- Mappings:
Namespace Name Mixin selector named doAcceptLnet/minecraft/nbt/NbtElement;doAccept(Lnet/minecraft/nbt/scanner/NbtScanner;)Lnet/minecraft/nbt/scanner/NbtScanner$Result;intermediary method_39850Lnet/minecraft/class_2520;method_39850(Lnet/minecraft/class_6836;)Lnet/minecraft/class_6836$class_6838;official aLva;a(Lux;)Lux$b;
-