| Constructor and Description |
|---|
CompoundTag()
Create an empty compound tag.
|
CompoundTag(java.util.Map<java.lang.String,INbtTag> value)
Create a compound tag from a map.
|
| Modifier and Type | Method and Description |
|---|---|
CompoundTag |
add(java.lang.String key,
INbtTag 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 |
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 INbtTag> |
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.
|
INbtTag |
copy() |
boolean |
equals(java.lang.Object o) |
<T extends INbtTag> |
get(java.lang.String key)
Get a tag from the map.
|
byte |
getByte(java.lang.String key)
Get a byte from the map.
|
byte[] |
getByteArray(java.lang.String key)
Get a byte array from the map.
|
CompoundTag |
getCompound(java.lang.String key)
Get a compound from the map.
|
double |
getDouble(java.lang.String key)
Get a double from the map.
|
float |
getFloat(java.lang.String key)
Get a float from the map.
|
int |
getInt(java.lang.String key)
Get an int from the map.
|
int[] |
getIntArray(java.lang.String key)
Get an int array from the map.
|
<T extends INbtTag> |
getList(java.lang.String key)
Get a list from the map.
|
<T extends INbtTag> |
getList(java.lang.String key,
NbtType type)
Get a list from the map with the given type.
|
long |
getLong(java.lang.String key)
Get a long from the map.
|
long[] |
getLongArray(java.lang.String key)
Get a long array from the map.
|
NbtType |
getNbtType() |
short |
getShort(java.lang.String key)
Get a short from the map.
|
java.lang.String |
getString(java.lang.String key)
Get a string from the map.
|
java.util.Map<java.lang.String,INbtTag> |
getValue() |
int |
hashCode() |
boolean |
isEmpty() |
java.util.Iterator<java.util.Map.Entry<java.lang.String,INbtTag>> |
iterator() |
INbtTag |
remove(java.lang.String key)
Remove a tag from the map.
|
CompoundTag |
setValue(java.util.Map<java.lang.String,INbtTag> 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, waitasByteArrayTag, asByteTag, asCompoundTag, asDoubleTag, asFloatTag, asIntArrayTag, asIntTag, asListTag, asLongArrayTag, asLongTag, asShortTag, asStringTagpublic CompoundTag()
public CompoundTag(java.util.Map<java.lang.String,INbtTag> value)
value - The mappublic java.util.Map<java.lang.String,INbtTag> getValue()
public CompoundTag setValue(java.util.Map<java.lang.String,INbtTag> 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)
INbtNumber 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 INbtTag> T get(java.lang.String key)
T - The tag typekey - The keypublic CompoundTag add(java.lang.String key, INbtTag 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 tag@Nullable public INbtTag remove(java.lang.String key)
key - The keypublic byte getByte(java.lang.String key)
key - The keypublic CompoundTag addByte(java.lang.String key, byte b)
key - The keyb - The bytepublic short getShort(java.lang.String key)
key - The keypublic CompoundTag addShort(java.lang.String key, short s)
key - The keys - The shortpublic int getInt(java.lang.String key)
key - The keypublic CompoundTag addInt(java.lang.String key, int i)
key - The keyi - The intpublic long getLong(java.lang.String key)
key - The keypublic CompoundTag addLong(java.lang.String key, long l)
key - The keyl - The longpublic float getFloat(java.lang.String key)
key - The keypublic CompoundTag addFloat(java.lang.String key, float f)
key - The keyf - The floatpublic double getDouble(java.lang.String key)
key - The keypublic 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 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 CompoundTag addString(java.lang.String key, java.lang.String s)
key - The keys - The stringpublic <T extends INbtTag> 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 INbtTag> 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 CompoundTag addList(java.lang.String key, ListTag<?> list)
key - The keylist - The listpublic <T extends INbtTag> 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 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 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 CompoundTag addLongArray(java.lang.String key, long... longs)
key - The keylongs - The long arraypublic boolean trim()
public NbtType getNbtType()
getNbtType in interface INbtTagpublic INbtTag copy()
public java.util.Iterator<java.util.Map.Entry<java.lang.String,INbtTag>> iterator()
iterator in interface java.lang.Iterable<java.util.Map.Entry<java.lang.String,INbtTag>>public boolean equals(java.lang.Object o)
public int hashCode()