Package net.minecraft.nbt
Class CompoundTag
java.lang.Object
net.minecraft.nbt.CompoundTag
- All Implemented Interfaces:
Tag
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final com.mojang.serialization.Codec
<CompoundTag> private static final org.slf4j.Logger
private static final int
private static final int
static final TagType
<CompoundTag> Fields inherited from interface net.minecraft.nbt.Tag
ARRAY_HEADER, MAX_DEPTH, OBJECT_HEADER, OBJECT_REFERENCE, STRING_SIZE, TAG_BYTE, TAG_BYTE_ARRAY, TAG_COMPOUND, TAG_DOUBLE, TAG_END, TAG_FLOAT, TAG_INT, TAG_INT_ARRAY, TAG_LIST, TAG_LONG, TAG_LONG_ARRAY, TAG_SHORT, TAG_STRING
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionaccept
(StreamTagVisitor p_197442_) void
accept
(TagVisitor p_177857_) boolean
copy()
entrySet()
boolean
void
forEach
(BiConsumer<String, Tag> p_409767_) getBoolean
(String p_128472_) boolean
getBooleanOr
(String p_409730_, boolean p_410716_) Optional
<byte[]> getByteArray
(String p_128464_) byte
getCompound
(String p_128470_) getCompoundOrEmpty
(String p_410263_) double
getDoubleOr
(String p_410157_, double p_410495_) float
getFloatOr
(String p_410440_, float p_410371_) byte
getId()
Optional
<int[]> getIntArray
(String p_128466_) int
getListOrEmpty
(String p_409758_) Optional
<long[]> getLongArray
(String p_128468_) long
getOptional
(String p_409622_) short
getShortOr
(String p_409927_, short p_410172_) getStringOr
(String p_410368_, String p_410785_) getType()
int
hashCode()
boolean
isEmpty()
keySet()
merge
(CompoundTag p_128392_) void
putBoolean
(String p_128380_, boolean p_128381_) void
void
putByteArray
(String p_128383_, byte[] p_128384_) void
void
void
void
putIntArray
(String p_128386_, int[] p_128387_) void
void
putLongArray
(String p_128389_, long[] p_128390_) void
void
<T> Optional
<T> read
(com.mojang.serialization.MapCodec<T> p_401035_) <T> Optional
<T> read
(com.mojang.serialization.MapCodec<T> p_401418_, com.mojang.serialization.DynamicOps<Tag> p_401213_) <T> Optional
<T> <T> Optional
<T> read
(String p_401362_, com.mojang.serialization.Codec<T> p_401434_, com.mojang.serialization.DynamicOps<Tag> p_401431_) (package private) static Tag
readNamedTagData
(TagType<?> p_128414_, String p_128415_, DataInput p_128416_, NbtAccounter p_128418_) void
protected CompoundTag
int
size()
int
<T> void
store
(com.mojang.serialization.MapCodec<T> p_401165_, com.mojang.serialization.DynamicOps<Tag> p_401224_, T p_401226_) <T> void
store
(com.mojang.serialization.MapCodec<T> p_401258_, T p_401416_) <T> void
store
(String p_401002_, com.mojang.serialization.Codec<T> p_401379_, com.mojang.serialization.DynamicOps<Tag> p_401063_, T p_401119_) <T> void
<T> void
storeNullable
(String p_404778_, com.mojang.serialization.Codec<T> p_405437_, com.mojang.serialization.DynamicOps<Tag> p_405108_, T p_405353_) <T> void
storeNullable
(String p_405110_, com.mojang.serialization.Codec<T> p_405799_, T p_405604_) toString()
values()
void
write
(DataOutput p_128341_) private static void
writeNamedTag
(String p_128369_, Tag p_128370_, DataOutput p_128371_) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.nbt.Tag
acceptAsRoot, asBoolean, asByte, asByteArray, asDouble, asFloat, asInt, asIntArray, asList, asLong, asLongArray, asNumber, asShort, asString
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
CODEC
-
SELF_SIZE_IN_BYTES
private static final int SELF_SIZE_IN_BYTES- See Also:
-
MAP_ENTRY_SIZE_IN_BYTES
private static final int MAP_ENTRY_SIZE_IN_BYTES- See Also:
-
TYPE
-
tags
-
-
Constructor Details
-
CompoundTag
-
CompoundTag
public CompoundTag()
-
-
Method Details
-
write
- Specified by:
write
in interfaceTag
- Throws:
IOException
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytes
in interfaceTag
-
keySet
-
entrySet
-
values
-
forEach
-
getId
public byte getId() -
getType
-
size
public int size() -
put
-
putByte
-
putShort
-
putInt
-
putLong
-
putFloat
-
putDouble
-
putString
-
putByteArray
-
putIntArray
-
putLongArray
-
putBoolean
-
get
-
contains
-
getOptional
-
getByte
-
getByteOr
-
getShort
-
getShortOr
-
getInt
-
getIntOr
-
getLong
-
getLongOr
-
getFloat
-
getFloatOr
-
getDouble
-
getDoubleOr
-
getString
-
getStringOr
-
getByteArray
-
getIntArray
-
getLongArray
-
getCompound
-
getCompoundOrEmpty
-
getList
-
getListOrEmpty
-
getBoolean
-
getBooleanOr
-
remove
-
toString
-
isEmpty
public boolean isEmpty() -
shallowCopy
-
copy
-
asCompound
- Specified by:
asCompound
in interfaceTag
-
equals
-
hashCode
public int hashCode() -
writeNamedTag
private static void writeNamedTag(String p_128369_, Tag p_128370_, DataOutput p_128371_) throws IOException - Throws:
IOException
-
readNamedTagData
static Tag readNamedTagData(TagType<?> p_128414_, String p_128415_, DataInput p_128416_, NbtAccounter p_128418_) -
merge
-
accept
-
accept
-
store
-
storeNullable
public <T> void storeNullable(String p_405110_, com.mojang.serialization.Codec<T> p_405799_, @Nullable T p_405604_) -
store
-
storeNullable
-
store
public <T> void store(com.mojang.serialization.MapCodec<T> p_401258_, T p_401416_) -
store
public <T> void store(com.mojang.serialization.MapCodec<T> p_401165_, com.mojang.serialization.DynamicOps<Tag> p_401224_, T p_401226_) -
read
-
read
-
read
-
read
-