EmptyPersistentCompound

A PersistentCompound which does nothing. Needed for empty holders such as net.minecraft.world.chunk.EmptyChunk for example.

Functions

Link copied to clipboard
fun clear()

Clears all persistent data from this compound.

Link copied to clipboard
inline operator fun <T : Any> get(key: CompoundKey<T>): T?

Tries to get the value for the given key and convert it to the given type T.

Link copied to clipboard
inline fun <T : Any> getAndRemove(key: CompoundKey<T>): T?

Removes the current value associated with the given key. Additionally, this function returns the value that was removed, if one was removed. Otherwise, the return value will be null.

Link copied to clipboard
inline fun <T : Any> getOrPut(key: CompoundKey<T>, defaultValue: () -> T): T

Executes the get function. If the result of the get function is null the defaultValue will be evaluated and put into the compound.

Link copied to clipboard
inline operator fun <T : Any> minusAssign(key: CompoundKey<T>)

Removes the current value associated with the given key.

Link copied to clipboard
fun remove(key: CompoundKey<*>)

Removes the current value associated with the given key.

Link copied to clipboard
operator fun <T : Any> set(key: CompoundKey<T>, value: T)

Puts the given value into the persistent storage.