Package net.minecraft.nbt
Class CompoundTag
java.lang.Object
net.minecraft.nbt.CompoundTag
- All Implemented Interfaces:
Tag
public class CompoundTag extends Object implements Tag
-
Field Summary
-
Constructor Summary
Constructors Modifier Constructor Description CompoundTag()
protected
CompoundTag(Map<String,Tag> tags)
-
Method Summary
Modifier and Type Method Description boolean
contains(String key)
boolean
contains(String key, int type)
boolean
containsUuid(String key)
Returnstrue
if thisCompoundTag
contains a valid UUID representation associated with the given key.CompoundTag
copy()
CompoundTag
copyFrom(CompoundTag source)
private CrashReport
createCrashReport(String key, TagReader<?> tagReader, ClassCastException classCastException)
boolean
equals(Object o)
protected static String
escapeTagKey(String key)
Tag
get(String key)
boolean
getBoolean(String key)
byte
getByte(String key)
byte[]
getByteArray(String key)
CompoundTag
getCompound(String key)
double
getDouble(String key)
float
getFloat(String key)
int
getInt(String key)
int[]
getIntArray(String key)
Set<String>
getKeys()
ListTag
getList(String key, int type)
long
getLong(String key)
long[]
getLongArray(String key)
TagReader<CompoundTag>
getReader()
short
getShort(String key)
int
getSize()
String
getString(String key)
byte
getType()
byte
getType(String key)
UUID
getUuid(String key)
Reads aUUID
from its NBT representation in thisCompoundTag
.int
hashCode()
boolean
isEmpty()
protected static Text
prettyPrintTagKey(String key)
Tag
put(String key, Tag tag)
void
putBoolean(String key, boolean value)
void
putByte(String key, byte value)
void
putByteArray(String key, byte[] value)
void
putDouble(String key, double value)
void
putFloat(String key, float value)
void
putInt(String key, int value)
void
putIntArray(String key, int[] value)
void
putIntArray(String key, List<Integer> value)
void
putLong(String key, long value)
void
putLongArray(String key, long[] value)
void
putLongArray(String key, List<Long> value)
void
putShort(String key, short value)
void
putString(String key, String value)
void
putUuid(String key, UUID value)
Writes aUUID
to its NBT representation in thisCompoundTag
.private static Tag
read(TagReader<?> reader, String key, DataInput input, int depth, PositionTracker tracker)
private static byte
readByte(DataInput input, PositionTracker tracker)
private static String
readString(DataInput input, PositionTracker tracker)
void
remove(String key)
protected Map<String,Tag>
toMap()
String
toString()
Text
toText(String indent, int depth)
void
write(DataOutput output)
private static void
write(String key, Tag tag, DataOutput output)
-
Field Details
-
CODEC
-
LOGGER
-
PATTERN
-
READER
-
tags
-
-
Constructor Details
-
CompoundTag
-
CompoundTag
public CompoundTag()
-
-
Method Details
-
write
- Specified by:
write
in interfaceTag
- Throws:
IOException
-
getKeys
-
getType
public byte getType() -
getReader
-
getSize
public int getSize() -
put
-
putByte
-
putShort
-
putInt
-
putLong
-
putUuid
Writes aUUID
to its NBT representation in thisCompoundTag
. -
getUuid
Reads aUUID
from its NBT representation in thisCompoundTag
. -
containsUuid
Returnstrue
if thisCompoundTag
contains a valid UUID representation associated with the given key. A valid UUID is represented by an int array of length 4. -
putFloat
-
putDouble
-
putString
-
putByteArray
-
putIntArray
-
putIntArray
-
putLongArray
-
putLongArray
-
putBoolean
-
get
-
getType
-
contains
-
contains
-
getByte
-
getShort
-
getInt
-
getLong
-
getFloat
-
getDouble
-
getString
-
getByteArray
-
getIntArray
-
getLongArray
-
getCompound
-
getList
-
getBoolean
-
remove
-
toString
-
isEmpty
public boolean isEmpty() -
createCrashReport
private CrashReport createCrashReport(String key, TagReader<?> tagReader, ClassCastException classCastException) -
copy
-
equals
-
hashCode
public int hashCode() -
write
- Throws:
IOException
-
readByte
- Throws:
IOException
-
readString
- Throws:
IOException
-
read
private static Tag read(TagReader<?> reader, String key, DataInput input, int depth, PositionTracker tracker) -
copyFrom
-
escapeTagKey
-
prettyPrintTagKey
-
toText
-
toMap
-