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
ConstructorsModifierConstructorDescriptionCompoundTag(int expectedEntries) Neo: create a compound tag that is generally suitable to hold the given amount of entries without needing to resize the internal map.protectedCompoundTag(Map<String, Tag> pTags) -
Method Summary
Modifier and TypeMethodDescriptionaccept(StreamTagVisitor pVisitor) voidaccept(TagVisitor pVisitor) booleanbooleanReturns whether the tag of the specifiedkeyis a particulartagType.copy()private CrashReportcreateReport(String pTagName, TagType<?> pType, ClassCastException pException) entrySet()booleanbooleangetBoolean(String pKey) bytebyte[]getByteArray(String pKey) getCompound(String pKey) doublefloatbytegetId()intint[]getIntArray(String pKey) longlong[]getLongArray(String pKey) shortbytegetTagType(String pKey) Gets the byte identifier of the tag of the specifiedkey, or0if no tag exists for thekey.getType()inthashCode()booleanbooleanisEmpty()merge(CompoundTag pOther) Copies all the tags ofotherinto this tag, then returns itself.voidputBoolean(String pKey, boolean pValue) voidvoidputByteArray(String pKey, byte[] pValue) voidputByteArray(String pKey, List<Byte> pValue) voidvoidvoidvoidputIntArray(String pKey, int[] pValue) voidputIntArray(String pKey, List<Integer> pValue) voidvoidputLongArray(String pKey, long[] pValue) voidputLongArray(String pKey, List<Long> pValue) voidvoidvoid(package private) static TagreadNamedTagData(TagType<?> pType, String pName, DataInput pInput, NbtAccounter pAccounter) voidprotected CompoundTagintsize()inttoString()voidwrite(DataOutput pOutput) private static voidwriteNamedTag(String pName, Tag pTag, DataOutput pOutput) 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() -
CompoundTag
public CompoundTag(int expectedEntries) Neo: create a compound tag that is generally suitable to hold the given amount of entries without needing to resize the internal map.- Parameters:
expectedEntries- the expected number of entries that the compound tag will have- See Also:
-
-
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
static Tag readNamedTagData(TagType<?> pType, String pName, DataInput pInput, NbtAccounter pAccounter) -
merge
Copies all the tags ofotherinto this tag, then returns itself.- See Also:
-
accept
-
entrySet
-
accept
-