Package-level declarations

Contains compound key creation and access to persistent compounds

Types

Link copied to clipboard
abstract class CompoundKey<T : Any>(val name: String)
Link copied to clipboard

This class provides a PersistentCompound. Providers are classes like net.minecraft.world.level.chunk.ChunkAccess, net.minecraft.world.entity.Entity and more.

Link copied to clipboard

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

Link copied to clipboard
abstract class PersistentCompound

Holds data which can be accessed fast because it is stored in memory. Additionally, the data will be stored persistently to the disk, if the game decides to do so.

Properties

Link copied to clipboard

Functions

Link copied to clipboard
inline fun <T : Any> compoundKey(id: ResourceLocation): CompoundKey<T>

Creates a CompoundKey which can be used to read and write data to a PersistentCompound in a typesafe way.

Link copied to clipboard
inline fun <T : Any, NbtType : Tag> customCompoundKey(id: ResourceLocation, crossinline valueToNbt: (value: T) -> NbtType, crossinline nbtToValue: (nbtElement: NbtType) -> T): CompoundKey<T>
@JvmName(name = "customCompoundKeyNbtElement")
inline fun <T : Any> customCompoundKey(id: ResourceLocation, crossinline convertValueToNbtElement: (value: T) -> Tag, crossinline convertNbtElementToValue: (nbtElement: Tag) -> T): CompoundKey<T>

Creates a CompoundKey which can be used to read and write data to a PersistentCompound in a typesafe way.

Link copied to clipboard
inline fun <T : Tag> nbtElementCompoundKey(id: ResourceLocation): CompoundKey<T>

Creates a CompoundKey which can be used to read and write data to a PersistentCompound in a typesafe way.