NBTCompoundLike

interface NBTCompoundLike : NBTCompoundGetters, Iterable<CompoundEntry>

Functions

asMapView
Link copied to clipboard
abstract fun asMapView(): Map<String, NBT>
Returns a Map representing this compound.
contains
Link copied to clipboard
open operator fun contains(key: String): Boolean
Checks if the compound contains the given key.
containsKey
Link copied to clipboard
open fun containsKey(key: String): Boolean
Returns true if the compound contains the specified key.
containsValue
Link copied to clipboard
open fun containsValue(value: NBT): Boolean
Returns true if the compound maps one or more keys to the specified value.
forEach
Link copied to clipboard
open fun forEach(p0: Consumer<in Map.Entry<String, NBT>>)
open fun forEach(action: BiConsumer<String, NBT>)
Performs the given action on each entry.
open fun forEach(action: (CompoundEntry) -> Unit)
Performs the given action on each entry.
get
Link copied to clipboard
open operator override fun get(key: String): NBT?
Returns the value corresponding to the given key, or null if such a key is not present in the compound.
getAsByte
Link copied to clipboard
open fun getAsByte(key: String): Byte?
Calls getNumber and cast to the desired type.
getAsDouble
Link copied to clipboard
open fun getAsDouble(key: String): Double?
Calls getNumber and cast to the desired type.
getAsFloat
Link copied to clipboard
open fun getAsFloat(key: String): Float?
Calls getNumber and cast to the desired type.
getAsInt
Link copied to clipboard
open fun getAsInt(key: String): Int?
Calls getNumber and cast to the desired type.
getAsLong
Link copied to clipboard
open fun getAsLong(key: String): Long?
Calls getNumber and cast to the desired type.
getAsShort
Link copied to clipboard
open fun getAsShort(key: String): Short?
Calls getNumber and cast to the desired type.
getBoolean
Link copied to clipboard
open fun getBoolean(key: String): Boolean?
Returns the value associated to the given key, if any.
getByte
Link copied to clipboard
open fun getByte(key: String): Byte?
Returns the value associated to the given key, if any.
getByteArray
Link copied to clipboard
open fun getByteArray(key: String): ImmutableByteArray?
Returns the value associated to the given key, if any.
getCompound
Link copied to clipboard
open fun getCompound(key: String): NBTCompound?
Returns the value associated to the given key, if any.
getDouble
Link copied to clipboard
open fun getDouble(key: String): Double?
Returns the value associated to the given key, if any.
getFloat
Link copied to clipboard
open fun getFloat(key: String): Float?
Returns the value associated to the given key, if any.
getInt
Link copied to clipboard
open fun getInt(key: String): Int?
Returns the value associated to the given key, if any.
getIntArray
Link copied to clipboard
open fun getIntArray(key: String): ImmutableIntArray?
Returns the value associated to the given key, if any.
getList
Link copied to clipboard
open fun <T : NBT> getList(key: String): NBTList<T>?
Returns the value associated to the given key, if any.
getLong
Link copied to clipboard
open fun getLong(key: String): Long?
Returns the value associated to the given key, if any.
getLongArray
Link copied to clipboard
open fun getLongArray(key: String): ImmutableLongArray?
Returns the value associated to the given key, if any.
getNumber
Link copied to clipboard
open fun getNumber(key: String): Number?
Returns the value associated to the given key, if any.
getOrElse
Link copied to clipboard
open fun getOrElse(key: String, defaultValue: NBT): NBT
Returns the value associated to the given key, if any.
getShort
Link copied to clipboard
open fun getShort(key: String): Short?
Returns the value associated to the given key, if any.
getString
Link copied to clipboard
open fun getString(key: String): String?
Returns the value associated to the given key, if any.
isEmpty
Link copied to clipboard
open fun isEmpty(): Boolean
Returns true if the compound is empty (contains no elements), false otherwise.
iterator
Link copied to clipboard
open operator override fun iterator(): Iterator<CompoundEntry>
Returns an Iterator over the entries in the compound.
plus
Link copied to clipboard
abstract operator fun plus(other: NBTCompoundLike): NBTCompoundLike
Creates a new NBTCompoundLike by replacing or adding entries from this compound with entries from 'other'
spliterator
Link copied to clipboard
open fun spliterator(): Spliterator<CompoundEntry>
toCompound
Link copied to clipboard
@Contract(pure = true)
abstract fun toCompound(): NBTCompound
Creates a NBTCompound.
toMutableCompound
Link copied to clipboard
abstract fun toMutableCompound(): MutableNBTCompound
Returns a new mutable map containing all key-value pairs from the original compound.
toSNBT
Link copied to clipboard
open fun toSNBT(): String
Same semantics than NBT#toSNBT

Properties

entries
Link copied to clipboard
open val entries: Set<CompoundEntry>
Returns a read-only Set of all key/value pairs in this compound.
keys
Link copied to clipboard
open val keys: Set<String>
Returns a read-only Set of all keys in this compound.
size
Link copied to clipboard
open val size: Int
Returns the number of key/value pairs in the compound.
values
Link copied to clipboard
open val values: Collection<NBT>
Returns a read-only Collection of all values in this compound.

Inheritors

NBTCompound
Link copied to clipboard
MutableNBTCompound
Link copied to clipboard