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 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_ANY_NUMERIC, 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 visitor) void
accept
(TagVisitor visitor) boolean
boolean
Returns whether the tag of the specifiedkey
is a particulartagType
.copy()
private CrashReport
createReport
(String tagName, TagType<?> type, ClassCastException exception) entrySet()
boolean
boolean
getBoolean
(String key) byte
byte[]
getByteArray
(String key) getCompound
(String key) double
float
byte
getId()
int
int[]
getIntArray
(String key) long
long[]
getLongArray
(String key) short
byte
getTagType
(String key) Gets the byte identifier of the tag of the specifiedkey
, or0
if no tag exists for thekey
.getType()
int
hashCode()
boolean
boolean
isEmpty()
merge
(CompoundTag other) Copies all the tags ofother
into this tag, then returns itself.void
putBoolean
(String key, boolean value) void
void
putByteArray
(String key, byte[] value) void
putByteArray
(String key, List<Byte> value) void
void
void
void
putIntArray
(String key, int[] value) void
putIntArray
(String key, List<Integer> value) void
void
putLongArray
(String key, long[] value) void
putLongArray
(String key, List<Long> value) void
void
void
(package private) static Tag
readNamedTagData
(TagType<?> type, String name, DataInput input, NbtAccounter accounter) void
protected CompoundTag
int
size()
int
toString()
void
write
(DataOutput output) private static void
writeNamedTag
(String name, Tag tag, DataOutput output) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.nbt.Tag
acceptAsRoot, getAsString
-
Field Details
-
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
-
getAllKeys
-
getId
public byte getId() -
getType
-
size
public int size() -
put
-
putByte
-
putShort
-
putInt
-
putLong
-
putUUID
-
getUUID
-
hasUUID
-
putFloat
-
putDouble
-
putString
-
putByteArray
-
putByteArray
-
putIntArray
-
putIntArray
-
putLongArray
-
putLongArray
-
putBoolean
-
get
-
getTagType
Gets the byte identifier of the tag of the specifiedkey
, or0
if no tag exists for thekey
. -
contains
-
contains
Returns whether the tag of the specifiedkey
is a particulartagType
. If thetagType
is99
, all numeric tags will be checked against the type of the stored tag. -
getByte
-
getShort
-
getInt
-
getLong
-
getFloat
-
getDouble
-
getString
-
getByteArray
-
getIntArray
-
getLongArray
-
getCompound
-
getList
-
getBoolean
-
remove
-
toString
-
isEmpty
public boolean isEmpty() -
createReport
-
shallowCopy
-
copy
-
equals
-
hashCode
public int hashCode() -
writeNamedTag
- Throws:
IOException
-
readNamedTagData
-
merge
Copies all the tags ofother
into this tag, then returns itself.- See Also:
-
accept
-
entrySet
-
accept
-