Modifier and Type | Field and Description |
---|---|
static com.mojang.serialization.Codec<CompoundTag> |
CODEC |
private static Logger |
LOGGER |
private static Pattern |
PATTERN |
static TagReader<CompoundTag> |
READER |
private Map<String,Tag> |
tags |
Modifier | Constructor and Description |
---|---|
|
CompoundTag() |
protected |
CompoundTag(Map<String,Tag> tags) |
Modifier and Type | Method and Description |
---|---|
boolean |
contains(String key) |
boolean |
contains(String key,
int type) |
boolean |
containsUuid(String key)
Returns
true if this CompoundTag 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 a
UUID from its NBT representation in this CompoundTag . |
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,
List<Long> value) |
void |
putLongArray(String key,
long[] value) |
void |
putShort(String key,
short value) |
void |
putString(String key,
String value) |
void |
putUuid(String key,
UUID value)
Writes a
UUID to its NBT representation in this CompoundTag . |
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) |
public static final com.mojang.serialization.Codec<CompoundTag> CODEC
private static final Logger LOGGER
private static final Pattern PATTERN
public static final TagReader<CompoundTag> READER
public void write(DataOutput output) throws IOException
write
in interface Tag
IOException
public TagReader<CompoundTag> getReader()
public int getSize()
public void putByte(String key, byte value)
public void putShort(String key, short value)
public void putInt(String key, int value)
public void putLong(String key, long value)
public void putUuid(String key, UUID value)
UUID
to its NBT representation in this CompoundTag
.public UUID getUuid(String key)
UUID
from its NBT representation in this CompoundTag
.public boolean containsUuid(String key)
true
if this CompoundTag
contains a valid UUID representation associated with the given key.
A valid UUID is represented by an int array of length 4.public void putFloat(String key, float value)
public void putDouble(String key, double value)
public void putByteArray(String key, byte[] value)
public void putIntArray(String key, int[] value)
public void putLongArray(String key, long[] value)
public void putBoolean(String key, boolean value)
public byte getType(String key)
public boolean contains(String key)
public boolean contains(String key, int type)
public byte getByte(String key)
public short getShort(String key)
public int getInt(String key)
public long getLong(String key)
public float getFloat(String key)
public double getDouble(String key)
public byte[] getByteArray(String key)
public int[] getIntArray(String key)
public long[] getLongArray(String key)
public CompoundTag getCompound(String key)
public boolean getBoolean(String key)
public void remove(String key)
public String toString()
public boolean isEmpty()
private CrashReport createCrashReport(String key, TagReader<?> tagReader, ClassCastException classCastException)
public CompoundTag copy()
private static void write(String key, Tag tag, DataOutput output) throws IOException
IOException
private static byte readByte(DataInput input, PositionTracker tracker) throws IOException
IOException
private static String readString(DataInput input, PositionTracker tracker) throws IOException
IOException
private static Tag read(TagReader<?> reader, String key, DataInput input, int depth, PositionTracker tracker)
public CompoundTag copyFrom(CompoundTag source)