Class NbtCompound
- All Implemented Interfaces:
NbtElement
HashMap<String, NbtElement>
. Note that this does not implement
Map
. Its type is 0xa. To get the compound
as a map, use toMap()
.
There are two ways to use this compound; one is to create NBT instances yourself and use
get(String)
or put(String, NbtElement)
. Manual casting is required in
this case. The other, easier way is to use methods with type names, such as
getInt(String)
or putInt(String, int)
. Where applicable, these methods
return and accept Java types (e.g. int
, long[]
) instead of NbtElement
subclasses. Note that there is no putCompound
method, since you can just use the
put method. These getters also have the advantage of providing type safety, because if
type mismatch occurs or there is no such element in the compound, it returns the default
value for that type instead of throwing or returning null
.
- Mappings:
Namespace Name official qw
intermediary net/minecraft/class_2487
named net/minecraft/nbt/NbtCompound
-
Field Summary
Modifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec<NbtCompound>
private final Map<String,
NbtElement> private static final int
private static final int
static final NbtType<NbtCompound>
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, NUMBER_TYPE, SHORT_TYPE, STRING_TYPE
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(NbtElementVisitor visitor) boolean
Determines whether the NBT compound object contains the specified key.boolean
Returns whether the NBT compound object contains an element of the specified type at the specified key.boolean
containsUuid
(String key) Returnstrue
if thisNbtCompound
contains a valid UUID representation associated with the given key.copy()
Returns an NBT element of equal value that won't change with this element.copyFrom
(NbtCompound source) Merges the entries ofsource
to this compound.private CrashReport
createCrashReport
(String key, NbtType<?> reader, ClassCastException exception) doAccept
(NbtScanner visitor) boolean
Returns the element associated with the key from this compound, ornull
if there is none.boolean
getBoolean
(String key) Returns the boolean value stored with thekey
.byte
Returns thebyte
associated withkey
, or0
if there is no number stored with the key.byte[]
getByteArray
(String key) Returns the byte array associated withkey
, or an empty byte array if there is no byte array stored with the key.getCompound
(String key) Returns the compound associated withkey
, or an empty compound if there is no compound stored with the key.double
Returns thedouble
associated withkey
, or0.0
if there is no number stored with the key.float
Returns thefloat
associated withkey
, or0.0f
if there is no number stored with the key.int
Returns theint
associated withkey
, or0
if there is no number stored with the key.int[]
getIntArray
(String key) Returns the int array associated withkey
, or an empty int array if there is no int array stored with the key.getKeys()
Returns the set of keys in this compound.Returns the list associated withkey
, or an empty list if there is no list stored with the key and the type.long
Returns thelong
associated withkey
, or0L
if there is no number stored with the key.long[]
getLongArray
(String key) Returns the long array associated withkey
, or an empty long array if there is no long array stored with the key.Returns the NBT type definition of this NBT element.short
Returns theshort
associated withkey
, or0
if there is no number stored with the key.int
getSize()
Returns the size of this compound.int
Returns theString
associated withkey
, or an empty string if there is no string stored with the key.byte
getType()
Returns the type of this NBT element.byte
Gets the NBT type of the element stored at the specified key.Returns aUUID
from its NBT representation in this compound.int
hashCode()
boolean
isEmpty()
Returns whether the compound has no entries.put
(String key, NbtElement element) Puts an element to this compound.void
putBoolean
(String key, boolean value) Puts aboolean
to this compound.void
Puts abyte
to this compound.void
putByteArray
(String key, byte[] value) Puts a byte array to this compound.void
putByteArray
(String key, List<Byte> value) Puts a list of bytes to this compound.void
Puts adouble
to this compound.void
Puts afloat
to this compound.void
Puts anint
to this compound.void
putIntArray
(String key, int[] value) Puts an int array to this compound.void
putIntArray
(String key, List<Integer> value) Puts a list of integers to this compound.void
Puts along
to this compound.void
putLongArray
(String key, long[] value) Puts a long array to this compound.void
putLongArray
(String key, List<Long> value) Puts a list of longs to this compound.void
Puts ashort
to this compound.void
Puts aString
to this compound.void
Puts aUUID
's NBT representation to this compound.(package private) static NbtElement
read
(NbtType<?> reader, String key, DataInput input, NbtTagSizeTracker nbtTagSizeTracker) void
Removes the entry with the specifiedkey
.protected Map<String,
NbtElement> toMap()
Returns the compound as an unmodifiable map.toString()
void
write
(DataOutput output) Writes the NBT element tooutput
.private static void
write
(String key, NbtElement element, DataOutput output) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.nbt.NbtElement
accept, asString
-
Field Details
-
CODEC
- Mappings:
Namespace Name Mixin selector official a
Lqw;a:Lcom/mojang/serialization/Codec;
intermediary field_25128
Lnet/minecraft/class_2487;field_25128:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/nbt/NbtCompound;CODEC:Lcom/mojang/serialization/Codec;
-
SIZE
private static final int SIZE- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lqw;c:I
intermediary field_41718
Lnet/minecraft/class_2487;field_41718:I
named SIZE
Lnet/minecraft/nbt/NbtCompound;SIZE:I
-
field_41719
private static final int field_41719- See Also:
- Mappings:
Namespace Name Mixin selector official w
Lqw;w:I
intermediary field_41719
Lnet/minecraft/class_2487;field_41719:I
named field_41719
Lnet/minecraft/nbt/NbtCompound;field_41719:I
-
TYPE
- Mappings:
Namespace Name Mixin selector official b
Lqw;b:Lrs;
intermediary field_21029
Lnet/minecraft/class_2487;field_21029:Lnet/minecraft/class_4614;
named TYPE
Lnet/minecraft/nbt/NbtCompound;TYPE:Lnet/minecraft/nbt/NbtType;
-
entries
- Mappings:
Namespace Name Mixin selector official x
Lqw;x:Ljava/util/Map;
intermediary field_11515
Lnet/minecraft/class_2487;field_11515:Ljava/util/Map;
named entries
Lnet/minecraft/nbt/NbtCompound;entries:Ljava/util/Map;
-
-
Constructor Details
-
NbtCompound
- Mappings:
Namespace Name Mixin selector official <init>
Lqw;<init>(Ljava/util/Map;)V
intermediary <init>
Lnet/minecraft/class_2487;<init>(Ljava/util/Map;)V
named <init>
Lnet/minecraft/nbt/NbtCompound;<init>(Ljava/util/Map;)V
-
NbtCompound
public NbtCompound()
-
-
Method Details
-
write
Writes the NBT element tooutput
.- Specified by:
write
in interfaceNbtElement
- Throws:
IOException
- Mappings:
Namespace Name Mixin selector official a
Lrq;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()- Specified by:
getSizeInBytes
in interfaceNbtElement
- Mappings:
Namespace Name Mixin selector official a
Lrq;a()I
intermediary method_47988
Lnet/minecraft/class_2520;method_47988()I
named getSizeInBytes
Lnet/minecraft/nbt/NbtElement;getSizeInBytes()I
-
getKeys
Returns the set of keys in this compound.- Returns:
- the set of keys in this compound
- Mappings:
Namespace Name Mixin selector official e
Lqw;e()Ljava/util/Set;
intermediary method_10541
Lnet/minecraft/class_2487;method_10541()Ljava/util/Set;
named getKeys
Lnet/minecraft/nbt/NbtCompound;getKeys()Ljava/util/Set;
-
getType
public byte getType()Returns the type of this NBT element.- Specified by:
getType
in interfaceNbtElement
- Returns:
- the type of this NBT element
- Mappings:
Namespace Name Mixin selector official b
Lrq;b()B
intermediary method_10711
Lnet/minecraft/class_2520;method_10711()B
named getType
Lnet/minecraft/nbt/NbtElement;getType()B
-
getNbtType
Returns the NBT type definition of this NBT element.- Specified by:
getNbtType
in interfaceNbtElement
- Returns:
- the NBT type definition of this NBT element
- Mappings:
Namespace Name Mixin selector official c
Lrq;c()Lrs;
intermediary method_23258
Lnet/minecraft/class_2520;method_23258()Lnet/minecraft/class_4614;
named getNbtType
Lnet/minecraft/nbt/NbtElement;getNbtType()Lnet/minecraft/nbt/NbtType;
-
getSize
public int getSize()Returns the size of this compound.- Returns:
- the size of this compound
- Mappings:
Namespace Name Mixin selector official f
Lqw;f()I
intermediary method_10546
Lnet/minecraft/class_2487;method_10546()I
named getSize
Lnet/minecraft/nbt/NbtCompound;getSize()I
-
put
Puts an element to this compound.- Returns:
- the previous value, or
null
if there was none - See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Lrq;)Lrq;
intermediary method_10566
Lnet/minecraft/class_2487;method_10566(Ljava/lang/String;Lnet/minecraft/class_2520;)Lnet/minecraft/class_2520;
named put
Lnet/minecraft/nbt/NbtCompound;put(Ljava/lang/String;Lnet/minecraft/nbt/NbtElement;)Lnet/minecraft/nbt/NbtElement;
-
putByte
Puts abyte
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;B)V
intermediary method_10567
Lnet/minecraft/class_2487;method_10567(Ljava/lang/String;B)V
named putByte
Lnet/minecraft/nbt/NbtCompound;putByte(Ljava/lang/String;B)V
-
putShort
Puts ashort
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;S)V
intermediary method_10575
Lnet/minecraft/class_2487;method_10575(Ljava/lang/String;S)V
named putShort
Lnet/minecraft/nbt/NbtCompound;putShort(Ljava/lang/String;S)V
-
putInt
Puts anint
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;I)V
intermediary method_10569
Lnet/minecraft/class_2487;method_10569(Ljava/lang/String;I)V
named putInt
Lnet/minecraft/nbt/NbtCompound;putInt(Ljava/lang/String;I)V
-
putLong
Puts along
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;J)V
intermediary method_10544
Lnet/minecraft/class_2487;method_10544(Ljava/lang/String;J)V
named putLong
Lnet/minecraft/nbt/NbtCompound;putLong(Ljava/lang/String;J)V
-
putUuid
Puts aUUID
's NBT representation to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Ljava/util/UUID;)V
intermediary method_25927
Lnet/minecraft/class_2487;method_25927(Ljava/lang/String;Ljava/util/UUID;)V
named putUuid
Lnet/minecraft/nbt/NbtCompound;putUuid(Ljava/lang/String;Ljava/util/UUID;)V
-
getUuid
Returns aUUID
from its NBT representation in this compound.- Returns:
- a
UUID
from its NBT representation in this compound - Throws:
IllegalArgumentException
- if there is no value with the key or the value associated with the key is not a valid NBT representation of a UUID- See Also:
- API Note:
- Unlike other specialized getters, this method can throw unchecked exceptions.
It is therefore recommended to call
containsUuid(String)
before getting the UUID. - Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;)Ljava/util/UUID;
intermediary method_25926
Lnet/minecraft/class_2487;method_25926(Ljava/lang/String;)Ljava/util/UUID;
named getUuid
Lnet/minecraft/nbt/NbtCompound;getUuid(Ljava/lang/String;)Ljava/util/UUID;
-
containsUuid
Returnstrue
if thisNbtCompound
contains a valid UUID representation associated with the given key. A valid UUID is represented by an int array of length 4.- Mappings:
Namespace Name Mixin selector official b
Lqw;b(Ljava/lang/String;)Z
intermediary method_25928
Lnet/minecraft/class_2487;method_25928(Ljava/lang/String;)Z
named containsUuid
Lnet/minecraft/nbt/NbtCompound;containsUuid(Ljava/lang/String;)Z
-
putFloat
Puts afloat
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;F)V
intermediary method_10548
Lnet/minecraft/class_2487;method_10548(Ljava/lang/String;F)V
named putFloat
Lnet/minecraft/nbt/NbtCompound;putFloat(Ljava/lang/String;F)V
-
putDouble
Puts adouble
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;D)V
intermediary method_10549
Lnet/minecraft/class_2487;method_10549(Ljava/lang/String;D)V
named putDouble
Lnet/minecraft/nbt/NbtCompound;putDouble(Ljava/lang/String;D)V
-
putString
Puts aString
to this compound.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Ljava/lang/String;)V
intermediary method_10582
Lnet/minecraft/class_2487;method_10582(Ljava/lang/String;Ljava/lang/String;)V
named putString
Lnet/minecraft/nbt/NbtCompound;putString(Ljava/lang/String;Ljava/lang/String;)V
-
putByteArray
Puts a byte array to this compound. This does not copy the array.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;[B)V
intermediary method_10570
Lnet/minecraft/class_2487;method_10570(Ljava/lang/String;[B)V
named putByteArray
Lnet/minecraft/nbt/NbtCompound;putByteArray(Ljava/lang/String;[B)V
-
putByteArray
Puts a list of bytes to this compound. This copies the list.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Ljava/util/List;)V
intermediary method_36110
Lnet/minecraft/class_2487;method_36110(Ljava/lang/String;Ljava/util/List;)V
named putByteArray
Lnet/minecraft/nbt/NbtCompound;putByteArray(Ljava/lang/String;Ljava/util/List;)V
-
putIntArray
Puts an int array to this compound. This does not copy the array.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;[I)V
intermediary method_10539
Lnet/minecraft/class_2487;method_10539(Ljava/lang/String;[I)V
named putIntArray
Lnet/minecraft/nbt/NbtCompound;putIntArray(Ljava/lang/String;[I)V
-
putIntArray
Puts a list of integers to this compound. This copies the list.- See Also:
- Mappings:
Namespace Name Mixin selector official b
Lqw;b(Ljava/lang/String;Ljava/util/List;)V
intermediary method_10572
Lnet/minecraft/class_2487;method_10572(Ljava/lang/String;Ljava/util/List;)V
named putIntArray
Lnet/minecraft/nbt/NbtCompound;putIntArray(Ljava/lang/String;Ljava/util/List;)V
-
putLongArray
Puts a long array to this compound. This does not copy the array.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;[J)V
intermediary method_10564
Lnet/minecraft/class_2487;method_10564(Ljava/lang/String;[J)V
named putLongArray
Lnet/minecraft/nbt/NbtCompound;putLongArray(Ljava/lang/String;[J)V
-
putLongArray
Puts a list of longs to this compound. This copies the list.- See Also:
- Mappings:
Namespace Name Mixin selector official c
Lqw;c(Ljava/lang/String;Ljava/util/List;)V
intermediary method_10538
Lnet/minecraft/class_2487;method_10538(Ljava/lang/String;Ljava/util/List;)V
named putLongArray
Lnet/minecraft/nbt/NbtCompound;putLongArray(Ljava/lang/String;Ljava/util/List;)V
-
putBoolean
Puts aboolean
to this compound. The value is stored asNbtByte
.- See Also:
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Z)V
intermediary method_10556
Lnet/minecraft/class_2487;method_10556(Ljava/lang/String;Z)V
named putBoolean
Lnet/minecraft/nbt/NbtCompound;putBoolean(Ljava/lang/String;Z)V
-
get
Returns the element associated with the key from this compound, ornull
if there is none.- Returns:
- the element associated with the key from this compound, or
null
if there is none - See Also:
- API Note:
- This method does not provide type safety; if the type is known, it is recommended to use other type-specific methods instead.
- Mappings:
Namespace Name Mixin selector official c
Lqw;c(Ljava/lang/String;)Lrq;
intermediary method_10580
Lnet/minecraft/class_2487;method_10580(Ljava/lang/String;)Lnet/minecraft/class_2520;
named get
Lnet/minecraft/nbt/NbtCompound;get(Ljava/lang/String;)Lnet/minecraft/nbt/NbtElement;
-
getType
Gets the NBT type of the element stored at the specified key.- Returns:
- the element NBT type, or
NbtElement.END_TYPE
if it does not exist - Mappings:
Namespace Name Mixin selector official d
Lqw;d(Ljava/lang/String;)B
intermediary method_10540
Lnet/minecraft/class_2487;method_10540(Ljava/lang/String;)B
named getType
Lnet/minecraft/nbt/NbtCompound;getType(Ljava/lang/String;)B
-
contains
Determines whether the NBT compound object contains the specified key.- Returns:
true
if the key exists, elsefalse
- Mappings:
Namespace Name Mixin selector official e
Lqw;e(Ljava/lang/String;)Z
intermediary method_10545
Lnet/minecraft/class_2487;method_10545(Ljava/lang/String;)Z
named contains
Lnet/minecraft/nbt/NbtCompound;contains(Ljava/lang/String;)Z
-
contains
Returns whether the NBT compound object contains an element of the specified type at the specified key.The type restriction can also be
NUMBER_TYPE
, which only allows any type of number.- Returns:
true
if the key exists and the element type is equivalent to the giventype
, elsefalse
- Mappings:
Namespace Name Mixin selector official b
Lqw;b(Ljava/lang/String;I)Z
intermediary method_10573
Lnet/minecraft/class_2487;method_10573(Ljava/lang/String;I)Z
named contains
Lnet/minecraft/nbt/NbtCompound;contains(Ljava/lang/String;I)Z
-
getByte
Returns thebyte
associated withkey
, or0
if there is no number stored with the key.If a non-byte numeric value is stored, this will cast the value.
- Returns:
- the
byte
associated withkey
, or0
if there is no number stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official f
Lqw;f(Ljava/lang/String;)B
intermediary method_10571
Lnet/minecraft/class_2487;method_10571(Ljava/lang/String;)B
named getByte
Lnet/minecraft/nbt/NbtCompound;getByte(Ljava/lang/String;)B
-
getShort
Returns theshort
associated withkey
, or0
if there is no number stored with the key.If a non-short numeric value is stored, this will cast the value.
- Returns:
- the
short
associated withkey
, or0
if there is no number stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official g
Lqw;g(Ljava/lang/String;)S
intermediary method_10568
Lnet/minecraft/class_2487;method_10568(Ljava/lang/String;)S
named getShort
Lnet/minecraft/nbt/NbtCompound;getShort(Ljava/lang/String;)S
-
getInt
Returns theint
associated withkey
, or0
if there is no number stored with the key.If a non-integer numeric value is stored, this will cast the value.
- Returns:
- the
int
associated withkey
, or0
if there is no number stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official h
Lqw;h(Ljava/lang/String;)I
intermediary method_10550
Lnet/minecraft/class_2487;method_10550(Ljava/lang/String;)I
named getInt
Lnet/minecraft/nbt/NbtCompound;getInt(Ljava/lang/String;)I
-
getLong
Returns thelong
associated withkey
, or0L
if there is no number stored with the key.If a non-long numeric value is stored, this will cast the value.
- Returns:
- the
long
associated withkey
, or0L
if there is no number stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official i
Lqw;i(Ljava/lang/String;)J
intermediary method_10537
Lnet/minecraft/class_2487;method_10537(Ljava/lang/String;)J
named getLong
Lnet/minecraft/nbt/NbtCompound;getLong(Ljava/lang/String;)J
-
getFloat
Returns thefloat
associated withkey
, or0.0f
if there is no number stored with the key.If a non-float numeric value is stored, this will cast the value.
- Returns:
- the
float
associated withkey
, or0.0f
if there is no number stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official j
Lqw;j(Ljava/lang/String;)F
intermediary method_10583
Lnet/minecraft/class_2487;method_10583(Ljava/lang/String;)F
named getFloat
Lnet/minecraft/nbt/NbtCompound;getFloat(Ljava/lang/String;)F
-
getDouble
Returns thedouble
associated withkey
, or0.0
if there is no number stored with the key.If a non-double numeric value is stored, this will cast the value.
- Returns:
- the
double
associated withkey
, or0.0
if there is no number stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official k
Lqw;k(Ljava/lang/String;)D
intermediary method_10574
Lnet/minecraft/class_2487;method_10574(Ljava/lang/String;)D
named getDouble
Lnet/minecraft/nbt/NbtCompound;getDouble(Ljava/lang/String;)D
-
getString
Returns theString
associated withkey
, or an empty string if there is no string stored with the key.- Returns:
- the
String
associated withkey
, or an empty string if there is no string stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official l
Lqw;l(Ljava/lang/String;)Ljava/lang/String;
intermediary method_10558
Lnet/minecraft/class_2487;method_10558(Ljava/lang/String;)Ljava/lang/String;
named getString
Lnet/minecraft/nbt/NbtCompound;getString(Ljava/lang/String;)Ljava/lang/String;
-
getByteArray
Returns the byte array associated withkey
, or an empty byte array if there is no byte array stored with the key.- Returns:
- the byte array associated with
key
, or an empty byte array if there is no byte array stored with the key - See Also:
- API Note:
- Modifying the returned array also modifies the NBT byte array.
- Mappings:
Namespace Name Mixin selector official m
Lqw;m(Ljava/lang/String;)[B
intermediary method_10547
Lnet/minecraft/class_2487;method_10547(Ljava/lang/String;)[B
named getByteArray
Lnet/minecraft/nbt/NbtCompound;getByteArray(Ljava/lang/String;)[B
-
getIntArray
Returns the int array associated withkey
, or an empty int array if there is no int array stored with the key.- Returns:
- the int array associated with
key
, or an empty int array if there is no int array stored with the key - See Also:
- API Note:
- Modifying the returned array also modifies the NBT int array.
- Mappings:
Namespace Name Mixin selector official n
Lqw;n(Ljava/lang/String;)[I
intermediary method_10561
Lnet/minecraft/class_2487;method_10561(Ljava/lang/String;)[I
named getIntArray
Lnet/minecraft/nbt/NbtCompound;getIntArray(Ljava/lang/String;)[I
-
getLongArray
Returns the long array associated withkey
, or an empty long array if there is no long array stored with the key.- Returns:
- the long array associated with
key
, or an empty long array if there is no long array stored with the key - See Also:
- API Note:
- Modifying the returned array also modifies the NBT long array.
- Mappings:
Namespace Name Mixin selector official o
Lqw;o(Ljava/lang/String;)[J
intermediary method_10565
Lnet/minecraft/class_2487;method_10565(Ljava/lang/String;)[J
named getLongArray
Lnet/minecraft/nbt/NbtCompound;getLongArray(Ljava/lang/String;)[J
-
getCompound
Returns the compound associated withkey
, or an empty compound if there is no compound stored with the key.- Returns:
- the compound associated with
key
, or an empty compound if there is no compound stored with the key - See Also:
- Mappings:
Namespace Name Mixin selector official p
Lqw;p(Ljava/lang/String;)Lqw;
intermediary method_10562
Lnet/minecraft/class_2487;method_10562(Ljava/lang/String;)Lnet/minecraft/class_2487;
named getCompound
Lnet/minecraft/nbt/NbtCompound;getCompound(Ljava/lang/String;)Lnet/minecraft/nbt/NbtCompound;
-
getList
Returns the list associated withkey
, or an empty list if there is no list stored with the key and the type.- Parameters:
type
- the expected held type of the list- Returns:
- the list associated with
key
, or an empty list if there is no list stored with the key and the type - See Also:
- Mappings:
Namespace Name Mixin selector official c
Lqw;c(Ljava/lang/String;I)Lrc;
intermediary method_10554
Lnet/minecraft/class_2487;method_10554(Ljava/lang/String;I)Lnet/minecraft/class_2499;
named getList
Lnet/minecraft/nbt/NbtCompound;getList(Ljava/lang/String;I)Lnet/minecraft/nbt/NbtList;
-
getBoolean
Returns the boolean value stored with thekey
.- Returns:
- the boolean value stored with the
key
- Implementation Note:
- Since NBT does not have a boolean type,
NbtByte
is used instead. This method returnstrue
for any values which, after casting tobyte
as described atgetByte(String)
, is not0
. Since all non-numeric values become0
during casting to bytes, this method returnsfalse
for those as well. This includes values often considered truthy in other languages, such as a non-empty string or list. - Mappings:
Namespace Name Mixin selector official q
Lqw;q(Ljava/lang/String;)Z
intermediary method_10577
Lnet/minecraft/class_2487;method_10577(Ljava/lang/String;)Z
named getBoolean
Lnet/minecraft/nbt/NbtCompound;getBoolean(Ljava/lang/String;)Z
-
remove
Removes the entry with the specifiedkey
. Does nothing if there is none.- Mappings:
Namespace Name Mixin selector official r
Lqw;r(Ljava/lang/String;)V
intermediary method_10551
Lnet/minecraft/class_2487;method_10551(Ljava/lang/String;)V
named remove
Lnet/minecraft/nbt/NbtCompound;remove(Ljava/lang/String;)V
-
toString
- Specified by:
toString
in interfaceNbtElement
- Overrides:
toString
in classObject
-
isEmpty
public boolean isEmpty()Returns whether the compound has no entries.- Returns:
- whether the compound has no entries
- Mappings:
Namespace Name Mixin selector official g
Lqw;g()Z
intermediary method_33133
Lnet/minecraft/class_2487;method_33133()Z
named isEmpty
Lnet/minecraft/nbt/NbtCompound;isEmpty()Z
-
createCrashReport
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Lrs;Ljava/lang/ClassCastException;)Lo;
intermediary method_10559
Lnet/minecraft/class_2487;method_10559(Ljava/lang/String;Lnet/minecraft/class_4614;Ljava/lang/ClassCastException;)Lnet/minecraft/class_128;
named createCrashReport
Lnet/minecraft/nbt/NbtCompound;createCrashReport(Ljava/lang/String;Lnet/minecraft/nbt/NbtType;Ljava/lang/ClassCastException;)Lnet/minecraft/util/crash/CrashReport;
-
copy
Description copied from interface:NbtElement
Returns an NBT element of equal value that won't change with this element.- Specified by:
copy
in interfaceNbtElement
- Returns:
- an NBT element of equal value that won't change with this element
- Mappings:
Namespace Name Mixin selector official h
Lqw;h()Lqw;
intermediary method_10553
Lnet/minecraft/class_2487;method_10553()Lnet/minecraft/class_2487;
named copy
Lnet/minecraft/nbt/NbtCompound;copy()Lnet/minecraft/nbt/NbtCompound;
-
equals
-
hashCode
public int hashCode() -
write
- Throws:
IOException
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Ljava/lang/String;Lrq;Ljava/io/DataOutput;)V
intermediary method_10555
Lnet/minecraft/class_2487;method_10555(Ljava/lang/String;Lnet/minecraft/class_2520;Ljava/io/DataOutput;)V
named write
Lnet/minecraft/nbt/NbtCompound;write(Ljava/lang/String;Lnet/minecraft/nbt/NbtElement;Ljava/io/DataOutput;)V
-
read
static NbtElement read(NbtType<?> reader, String key, DataInput input, NbtTagSizeTracker nbtTagSizeTracker) - Mappings:
Namespace Name Mixin selector official a
Lqw;a(Lrs;Ljava/lang/String;Ljava/io/DataInput;Lrf;)Lrq;
intermediary method_10581
Lnet/minecraft/class_2487;method_10581(Lnet/minecraft/class_4614;Ljava/lang/String;Ljava/io/DataInput;Lnet/minecraft/class_2505;)Lnet/minecraft/class_2520;
named read
Lnet/minecraft/nbt/NbtCompound;read(Lnet/minecraft/nbt/NbtType;Ljava/lang/String;Ljava/io/DataInput;Lnet/minecraft/nbt/NbtTagSizeTracker;)Lnet/minecraft/nbt/NbtElement;
-
copyFrom
Merges the entries ofsource
to this compound. The passed compound will not be modified. If both compounds contain a compound with the same key, they will be merged; otherwise the values of this compound will be overwritten.- Returns:
- this compound with entries merged
- Mappings:
Namespace Name Mixin selector official a
Lqw;a(Lqw;)Lqw;
intermediary method_10543
Lnet/minecraft/class_2487;method_10543(Lnet/minecraft/class_2487;)Lnet/minecraft/class_2487;
named copyFrom
Lnet/minecraft/nbt/NbtCompound;copyFrom(Lnet/minecraft/nbt/NbtCompound;)Lnet/minecraft/nbt/NbtCompound;
-
accept
- Specified by:
accept
in interfaceNbtElement
- Mappings:
Namespace Name Mixin selector official a
Lrq;a(Lru;)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
-
toMap
Returns the compound as an unmodifiable map.Changes to this compound will be propagated to the returned map.
- Returns:
- the compound as an unmodifiable map
- Mappings:
Namespace Name Mixin selector official i
Lqw;i()Ljava/util/Map;
intermediary method_29143
Lnet/minecraft/class_2487;method_29143()Ljava/util/Map;
named toMap
Lnet/minecraft/nbt/NbtCompound;toMap()Ljava/util/Map;
-
doAccept
- Specified by:
doAccept
in interfaceNbtElement
- Mappings:
Namespace Name Mixin selector official a
Lrq;a(Lrn;)Lrn$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;
-