public interface ReadWriteNBT extends ReadableNBT
Modifier and Type | Method and Description |
---|---|
void |
clearNBT()
Remove all keys from this compound
|
ReadWriteNBT |
getCompound(String name) |
ReadWriteNBTCompoundList |
getCompoundList(String name) |
ReadWriteNBTList<Double> |
getDoubleList(String name) |
ReadWriteNBTList<Float> |
getFloatList(String name) |
ReadWriteNBTList<int[]> |
getIntArrayList(String name) |
ReadWriteNBTList<Integer> |
getIntegerList(String name) |
ReadWriteNBTList<Long> |
getLongList(String name) |
ReadWriteNBT |
getOrCreateCompound(String name)
The same as addCompound, just with a name that better reflects what it does
|
ReadWriteNBTList<String> |
getStringList(String name) |
ReadWriteNBTList<UUID> |
getUUIDList(String name) |
void |
mergeCompound(ReadableNBT comp)
Merges all data from comp into this compound.
|
void |
removeKey(String key) |
ReadWriteNBT |
resolveCompound(String key)
Returns the resolved Compound if exists, or null.
|
ReadWriteNBT |
resolveOrCreateCompound(String key)
Returns the resolved and creates compounds as required.
|
<T> void |
set(String key,
T value,
NBTHandler<T> handler)
Set an Object to a key via the provided handler.
|
void |
setBoolean(String key,
Boolean value)
Setter
|
void |
setByte(String key,
Byte value)
Setter
|
void |
setByteArray(String key,
byte[] value)
Setter
|
void |
setDouble(String key,
Double value)
Setter
|
<E extends Enum<?>> |
setEnum(String key,
E value)
Set a key to the given Enum value.
|
void |
setFloat(String key,
Float value)
Setter
|
void |
setIntArray(String key,
int[] value)
Setter
|
void |
setInteger(String key,
Integer value)
Setter
|
void |
setItemStack(String key,
org.bukkit.inventory.ItemStack item)
Save an ItemStack as a compound under a given key
|
void |
setItemStackArray(String key,
org.bukkit.inventory.ItemStack[] items)
Save an ItemStack Array as a compound under a given key
|
void |
setLong(String key,
Long value)
Setter
|
void |
setLongArray(String key,
long[] value)
Setter
Requires 1.16+
|
void |
setShort(String key,
Short value)
Setter
|
void |
setString(String key,
String value)
Setter
|
void |
setUUID(String key,
UUID value)
Setter
|
get, getBoolean, getByte, getByteArray, getDouble, getEnum, getFloat, getIntArray, getInteger, getItemStack, getItemStackArray, getKeys, getListType, getLong, getLongArray, getOrDefault, getOrNull, getShort, getString, getType, getUUID, hasTag, hasTag, resolveOrDefault, resolveOrNull, toString, writeCompound
void mergeCompound(ReadableNBT comp)
comp
- void setByteArray(String key, byte[] value)
key
- value
- void setIntArray(String key, int[] value)
key
- value
- void setLongArray(String key, long[] value)
key
- value
- void setItemStack(String key, org.bukkit.inventory.ItemStack item)
key
- item
- void setItemStackArray(String key, org.bukkit.inventory.ItemStack[] items)
key
- items
- void removeKey(String key)
key
- Deletes the given KeyReadWriteNBT getOrCreateCompound(String name)
name
- @Nullable ReadWriteNBT getCompound(String name)
getCompound
in interface ReadableNBT
name
- ReadWriteNBT resolveOrCreateCompound(String key)
key
- Path key, seperated by '.'. For example: "foo.bar.baz". Dots can
be escaped with a backslash.<T> void set(String key, T value, NBTHandler<T> handler)
T
- key
- value
- handler
- <E extends Enum<?>> void setEnum(String key, E value)
E
- key
- value
- ReadWriteNBTList<String> getStringList(String name)
getStringList
in interface ReadableNBT
ReadWriteNBTList<Integer> getIntegerList(String name)
getIntegerList
in interface ReadableNBT
ReadWriteNBTList<int[]> getIntArrayList(String name)
getIntArrayList
in interface ReadableNBT
ReadWriteNBTList<UUID> getUUIDList(String name)
getUUIDList
in interface ReadableNBT
ReadWriteNBTList<Float> getFloatList(String name)
getFloatList
in interface ReadableNBT
ReadWriteNBTList<Double> getDoubleList(String name)
getDoubleList
in interface ReadableNBT
ReadWriteNBTList<Long> getLongList(String name)
getLongList
in interface ReadableNBT
ReadWriteNBTCompoundList getCompoundList(String name)
getCompoundList
in interface ReadableNBT
@Nullable ReadWriteNBT resolveCompound(String key)
ReadableNBT
resolveCompound
in interface ReadableNBT
key
- Path key, seperated by '.'. For example: "foo.bar.baz". Dots can
be escaped with a backslash.void clearNBT()
Copyright © 2015–2024 tr7zw. All rights reserved.