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 intprivate static final intstatic 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) voidaccept(TagVisitor visitor) booleanbooleanReturns whether the tag of the specifiedkeyis a particulartagType.copy()private CrashReportcreateReport(String tagName, TagType<?> type, ClassCastException exception) entrySet()booleanbooleangetBoolean(String key) bytebyte[]getByteArray(String key) getCompound(String key) doublefloatbytegetId()intint[]getIntArray(String key) longlong[]getLongArray(String key) shortbytegetTagType(String key) Gets the byte identifier of the tag of the specifiedkey, or0if no tag exists for thekey.getType()inthashCode()booleanbooleanisEmpty()merge(CompoundTag other) Copies all the tags ofotherinto this tag, then returns itself.voidputBoolean(String key, boolean value) voidvoidputByteArray(String key, byte[] value) voidputByteArray(String key, List<Byte> value) voidvoidvoidvoidputIntArray(String key, int[] value) voidputIntArray(String key, List<Integer> value) voidvoidputLongArray(String key, long[] value) voidputLongArray(String key, List<Long> value) voidvoidvoid(package private) static TagreadNamedTagData(TagType<?> type, String name, DataInput input, NbtAccounter accounter) voidprotected CompoundTagintsize()inttoString()voidwrite(DataOutput output) private static voidwriteNamedTag(String name, Tag tag, DataOutput output) Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:
writein interfaceTag- Throws:
IOException
-
sizeInBytes
public int sizeInBytes()- Specified by:
sizeInBytesin 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, or0if no tag exists for thekey. -
contains
-
contains
Returns whether the tag of the specifiedkeyis a particulartagType. If thetagTypeis99, 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 ofotherinto this tag, then returns itself.- See Also:
-
accept
-
entrySet
-
accept
-