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 pVisitor) void
accept
(TagVisitor pVisitor) boolean
boolean
Returns whether the tag of the specifiedkey
is a particulartagType
.copy()
private CrashReport
createReport
(String pTagName, TagType<?> pType, ClassCastException pException) entrySet()
boolean
boolean
getBoolean
(String pKey) byte
byte[]
getByteArray
(String pKey) getCompound
(String pKey) double
float
byte
getId()
int
int[]
getIntArray
(String pKey) long
long[]
getLongArray
(String pKey) short
byte
getTagType
(String pKey) 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 pOther) Copies all the tags ofother
into this tag, then returns itself.void
putBoolean
(String pKey, boolean pValue) void
void
putByteArray
(String pKey, byte[] pValue) void
putByteArray
(String pKey, List<Byte> pValue) void
void
void
void
putIntArray
(String pKey, int[] pValue) void
putIntArray
(String pKey, List<Integer> pValue) void
void
putLongArray
(String pKey, long[] pValue) void
putLongArray
(String pKey, List<Long> pValue) void
void
void
(package private) static Tag
readNamedTagData
(TagType<?> pType, String pName, DataInput pInput, NbtAccounter pAccounter) void
protected CompoundTag
int
size()
int
toString()
void
write
(DataOutput pOutput) private static void
writeNamedTag
(String pName, Tag pTag, DataOutput pOutput) 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
static Tag readNamedTagData(TagType<?> pType, String pName, DataInput pInput, NbtAccounter pAccounter) -
merge
Copies all the tags ofother
into this tag, then returns itself.- See Also:
-
accept
-
entrySet
-
accept
-