NBTCompound

class NBTCompound @JvmOverloads() constructor(_tags: Map<String, NBT>) : NBT, NBTCompoundLike

Types

Companion
Link copied to clipboard
object Companion : NBTReaderCompanion<NBTCompound>

Functions

asMapView
Link copied to clipboard
open override 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.
equals
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
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.
hashCode
Link copied to clipboard
open override fun hashCode(): Int
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.
kmodify
Link copied to clipboard
@Contract(pure = true)
fun kmodify(lambda: MutableNBTCompound.() -> Unit): NBTCompound
modify
Link copied to clipboard
@Contract(pure = true)
fun modify(lambda: CompoundBuilder): NBTCompound
plus
Link copied to clipboard
open operator override fun plus(other: NBTCompoundLike): NBTCompound
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>
toByteArray
Link copied to clipboard
open fun toByteArray(): ByteArray
toCompound
Link copied to clipboard
open override fun toCompound(): NBTCompound
Creates a NBTCompound.
toMutableCompound
Link copied to clipboard
open override fun toMutableCompound(): MutableNBTCompound
Returns a new mutable map containing all key-value pairs from the original compound.
toSNBT
Link copied to clipboard
open override fun toSNBT(): String
Produces the stringified version of this NBT (or SNBT version).
toString
Link copied to clipboard
open override fun toString(): String
Produces a human-readable version of this tag.
withEntries
Link copied to clipboard
@Contract(pure = true)
fun withEntries(vararg entries: CompoundEntry): NBTCompound
withRemovedKeys
Link copied to clipboard
@Contract(pure = true)
fun withRemovedKeys(vararg keys: String): NBTCompound
writeContents
Link copied to clipboard
open override fun writeContents(destination: DataOutputStream)
Writes the contents of the tag to the given destination.

Properties

entries
Link copied to clipboard
open val entries: Set<CompoundEntry>
Returns a read-only Set of all key/value pairs in this compound.
ID
Link copied to clipboard
open override val ID: NBTType<NBTCompound>
ID of this tag type
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.
value
Link copied to clipboard
open override val value: Map<String, NBT>
values
Link copied to clipboard
open val values: Collection<NBT>
Returns a read-only Collection of all values in this compound.