| Constructor | Description |
|---|---|
CompoundTag() |
Create an empty compound tag.
|
CompoundTag(java.util.Map<java.lang.String,NbtTag> value) |
Create a compound tag from a map.
|
| Modifier and Type | Method | Description |
|---|---|---|
CompoundTag |
add(java.lang.String key,
NbtTag tag) |
Add a tag to the map.
|
CompoundTag |
add(java.lang.String key,
java.lang.Object o) |
Add a tag from its raw value to the map.
|
CompoundTag |
addAll(CompoundTag tag) |
Add all tags from the given compound tag to the map.
|
CompoundTag |
addBoolean(java.lang.String key,
boolean b) |
Add a boolean to the map.
|
CompoundTag |
addByte(java.lang.String key,
byte b) |
Add a byte to the map.
|
CompoundTag |
addByteArray(java.lang.String key,
byte... bytes) |
Add a byte array to the map.
|
CompoundTag |
addCompound(java.lang.String key,
CompoundTag compound) |
Add a compound to the map.
|
CompoundTag |
addDouble(java.lang.String key,
double d) |
Add a double to the map.
|
CompoundTag |
addFloat(java.lang.String key,
float f) |
Add a float to the map.
|
CompoundTag |
addInt(java.lang.String key,
int i) |
Add an int to the map.
|
CompoundTag |
addIntArray(java.lang.String key,
int... ints) |
Add an int array to the map.
|
CompoundTag |
addList(java.lang.String key,
ListTag<?> list) |
Add a list to the map.
|
CompoundTag |
addList(java.lang.String key,
java.lang.Object... items) |
Add a list to the map.
|
<T extends NbtTag> |
addList(java.lang.String key,
T... items) |
Add a list to the map.
|
CompoundTag |
addLong(java.lang.String key,
long l) |
Add a long to the map.
|
CompoundTag |
addLongArray(java.lang.String key,
long... longs) |
Add a long array to the map.
|
CompoundTag |
addShort(java.lang.String key,
short s) |
Add a short to the map.
|
CompoundTag |
addString(java.lang.String key,
java.lang.String s) |
Add a string to the map.
|
boolean |
contains(java.lang.String key) |
Get if the map contains a tag with the given name.
|
boolean |
contains(java.lang.String key,
NbtType type) |
Get if the map contains a tag with the given name and type.
|
boolean |
containsExact(java.lang.String key,
NbtType type) |
Get if the map contains a tag with the given name and exact type.
|
CompoundTag |
copy() |
|
boolean |
equals(java.lang.Object o) |
|
<T extends NbtTag> |
get(java.lang.String key) |
Get a tag from the map.
|
<T extends NbtTag> |
get(java.lang.String key,
T def) |
Get a tag from the map or the default value.
|
boolean |
getBoolean(java.lang.String key) |
Get a boolean from the map.
|
boolean |
getBoolean(java.lang.String key,
boolean def) |
Get a boolean from the map or the default value.
|
byte |
getByte(java.lang.String key) |
Get a byte from the map.
|
byte |
getByte(java.lang.String key,
byte def) |
Get a byte from the map or the default value.
|
byte[] |
getByteArray(java.lang.String key) |
Get a byte array from the map.
|
byte[] |
getByteArray(java.lang.String key,
byte[] def) |
Get a byte array from the map or the default value.
|
CompoundTag |
getCompound(java.lang.String key) |
Get a compound from the map.
|
CompoundTag |
getCompound(java.lang.String key,
CompoundTag def) |
Get a compound from the map or the default value.
|
double |
getDouble(java.lang.String key) |
Get a double from the map.
|
double |
getDouble(java.lang.String key,
double def) |
Get a double from the map or the default value.
|
float |
getFloat(java.lang.String key) |
Get a float from the map.
|
float |
getFloat(java.lang.String key,
float def) |
Get a float from the map or the default value.
|
int |
getInt(java.lang.String key) |
Get an int from the map.
|
int |
getInt(java.lang.String key,
int def) |
Get an int from the map or the default value.
|
int[] |
getIntArray(java.lang.String key) |
Get an int array from the map.
|
int[] |
getIntArray(java.lang.String key,
int[] def) |
Get an int array from the map or the default value.
|
<T extends NbtTag> |
getList(java.lang.String key) |
Get a list from the map.
|
<T extends NbtTag> |
getList(java.lang.String key,
ListTag<T> def) |
Get a list from the map or the default value.
|
<T extends NbtTag> |
getList(java.lang.String key,
NbtType type) |
Get a list from the map with the given type.
|
<T extends NbtTag> |
getList(java.lang.String key,
NbtType type,
ListTag<T> def) |
Get a list from the map with the given type or the default value.
|
long |
getLong(java.lang.String key) |
Get a long from the map.
|
long |
getLong(java.lang.String key,
long def) |
Get a long from the map or the default value.
|
long[] |
getLongArray(java.lang.String key) |
Get a long array from the map.
|
long[] |
getLongArray(java.lang.String key,
long[] def) |
Get a long array from the map or the default value.
|
NbtType |
getNbtType() |
|
short |
getShort(java.lang.String key) |
Get a short from the map.
|
short |
getShort(java.lang.String key,
short def) |
Get a short from the map or the default value.
|
java.lang.String |
getString(java.lang.String key) |
Get a string from the map.
|
java.lang.String |
getString(java.lang.String key,
java.lang.String def) |
Get a string from the map or the default value.
|
java.util.Map<java.lang.String,NbtTag> |
getValue() |
|
int |
hashCode() |
|
boolean |
isEmpty() |
|
java.util.Iterator<java.util.Map.Entry<java.lang.String,NbtTag>> |
iterator() |
|
NbtTag |
remove(java.lang.String key) |
Remove a tag from the map.
|
CompoundTag |
setValue(java.util.Map<java.lang.String,NbtTag> value) |
Set the map value.
|
int |
size() |
|
java.lang.String |
toString() |
|
boolean |
trim() |
Trim the map by removing empty tags.
|
clone, finalize, getClass, notify, notifyAll, wait, wait, waitasArrayTag, asByteArrayTag, asByteTag, asCompoundTag, asDoubleTag, asFloatTag, asIntArrayTag, asIntTag, asListTag, asLongArrayTag, asLongTag, asNumberTag, asShortTag, asStringTag, isArrayTag, isByteArrayTag, isByteTag, isCompoundTag, isDoubleTag, isFloatTag, isIntArrayTag, isIntTag, isListTag, isLongArrayTag, isLongTag, isNumberTag, isShortTag, isStringTagpublic CompoundTag()
public CompoundTag(java.util.Map<java.lang.String,NbtTag> value)
value - The mappublic java.util.Map<java.lang.String,NbtTag> getValue()
public CompoundTag setValue(java.util.Map<java.lang.String,NbtTag> value)
value - The new valuepublic int size()
public boolean isEmpty()
public boolean contains(java.lang.String key)
key - The keypublic boolean contains(java.lang.String key,
NbtType type)
NbtNumber any number type will be accepted.key - The keytype - The typepublic boolean containsExact(java.lang.String key,
NbtType type)
key - The keytype - The type@Nullable public <T extends NbtTag> T get(java.lang.String key)
T - The tag typekey - The keypublic <T extends NbtTag> T get(java.lang.String key, T def)
T - The tag typekey - The keydef - The default valuepublic CompoundTag add(java.lang.String key, NbtTag tag)
key - The keytag - The tagpublic CompoundTag add(java.lang.String key, java.lang.Object o)
key - The keyo - The raw valueUnknownTagTypeException - If the raw value can not be converted to a tagpublic CompoundTag addAll(CompoundTag tag)
tag - The compound tag@Nullable public NbtTag remove(java.lang.String key)
key - The keypublic boolean getBoolean(java.lang.String key)
key - The keypublic boolean getBoolean(java.lang.String key,
boolean def)
key - The keydef - The default valuepublic CompoundTag addBoolean(java.lang.String key, boolean b)
key - The keyb - The booleanpublic byte getByte(java.lang.String key)
key - The keypublic byte getByte(java.lang.String key,
byte def)
key - The keydef - The default valuepublic CompoundTag addByte(java.lang.String key, byte b)
key - The keyb - The bytepublic short getShort(java.lang.String key)
key - The keypublic short getShort(java.lang.String key,
short def)
key - The keydef - The default valuepublic CompoundTag addShort(java.lang.String key, short s)
key - The keys - The shortpublic int getInt(java.lang.String key)
key - The keypublic int getInt(java.lang.String key,
int def)
key - The keydef - The default valuepublic CompoundTag addInt(java.lang.String key, int i)
key - The keyi - The intpublic long getLong(java.lang.String key)
key - The keypublic long getLong(java.lang.String key,
long def)
key - The keydef - The default valuepublic CompoundTag addLong(java.lang.String key, long l)
key - The keyl - The longpublic float getFloat(java.lang.String key)
key - The keypublic float getFloat(java.lang.String key,
float def)
key - The keydef - The default valuepublic CompoundTag addFloat(java.lang.String key, float f)
key - The keyf - The floatpublic double getDouble(java.lang.String key)
key - The keypublic double getDouble(java.lang.String key,
double def)
key - The keydef - The default valuepublic CompoundTag addDouble(java.lang.String key, double d)
key - The keyd - The doublepublic byte[] getByteArray(java.lang.String key)
key - The keynew byte[0] if the map does not contain the given key or the tag is not a byte arraypublic byte[] getByteArray(java.lang.String key,
byte[] def)
key - The keydef - The default valuepublic CompoundTag addByteArray(java.lang.String key, byte... bytes)
key - The keybytes - The byte arraypublic java.lang.String getString(java.lang.String key)
key - The key"" if the map does not contain the given key or the tag is not a stringpublic java.lang.String getString(java.lang.String key,
java.lang.String def)
key - The keydef - The default valuepublic CompoundTag addString(java.lang.String key, java.lang.String s)
key - The keys - The stringpublic <T extends NbtTag> ListTag<T> getList(java.lang.String key)
T - The type of the listkey - The keynew ListTag<>() if the map does not contain the given key or the tag is not a listpublic <T extends NbtTag> ListTag<T> getList(java.lang.String key, ListTag<T> def)
T - The type of the listkey - The keydef - The default valuepublic <T extends NbtTag> ListTag<T> getList(java.lang.String key, NbtType type)
T - The type of the listkey - The keytype - The typenew ListTag<>() if the map does not contain the given key or the tag is not a listpublic <T extends NbtTag> ListTag<T> getList(java.lang.String key, NbtType type, ListTag<T> def)
T - The type of the listkey - The keytype - The typedef - The default valuepublic CompoundTag addList(java.lang.String key, ListTag<?> list)
key - The keylist - The listpublic <T extends NbtTag> void addList(java.lang.String key, T... items)
T - The type of the itemskey - The keyitems - The itemsjava.lang.IllegalArgumentException - If the type of the items is mixedpublic CompoundTag addList(java.lang.String key, java.lang.Object... items)
key - The keyitems - The raw itemsUnknownTagTypeException - If the type of the items is unknownjava.lang.IllegalArgumentException - If the type of the items is mixedpublic CompoundTag getCompound(java.lang.String key)
key - The keynew CompoundTag() if the map does not contain the given key or the tag is not a compoundpublic CompoundTag getCompound(java.lang.String key, CompoundTag def)
key - The keydef - The default valuepublic CompoundTag addCompound(java.lang.String key, CompoundTag compound)
key - The keycompound - The compoundpublic int[] getIntArray(java.lang.String key)
key - The keynew int[0] if the map does not contain the given key or the tag is not an int arraypublic int[] getIntArray(java.lang.String key,
int[] def)
key - The keydef - The default valuepublic CompoundTag addIntArray(java.lang.String key, int... ints)
key - The keyints - The int arraypublic long[] getLongArray(java.lang.String key)
key - The keynew long[0] if the map does not contain the given key or the tag is not a long arraypublic long[] getLongArray(java.lang.String key,
long[] def)
key - The keydef - The default valuepublic CompoundTag addLongArray(java.lang.String key, long... longs)
key - The keylongs - The long arraypublic boolean trim()
public NbtType getNbtType()
getNbtType in interface NbtTagpublic CompoundTag copy()
public java.util.Iterator<java.util.Map.Entry<java.lang.String,NbtTag>> iterator()
iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,NbtTag>>public boolean equals(java.lang.Object o)
public int hashCode()