Package-level declarations

Types

Link copied to clipboard

A mutable NovaRegistry that allows registering entries and tags via set. After initialization, the registry can be frozen to prevent further modifications and bind values to entries.

Link copied to clipboard

A thread-safe storage for values identified by keys.

Link copied to clipboard
interface NovaRegistryElement<out S : NovaRegistryElement<S>> : Keyed

Something that is registered in a NovaRegistry.

Link copied to clipboard
sealed interface NovaTagEntry<T : NovaRegistryElement<T>>

An entry in a pre-flattened Nova tag.

Link copied to clipboard
interface RegistryContext

Service for working with paper registries.

Link copied to clipboard
sealed interface RegistryEntry<out T : Keyed> : Provider<T>

Represents a key-value pair in a registry.

Link copied to clipboard
sealed interface RegistryEntrySet<out T : Keyed> : Provider<Set<T>>

A set of RegistryEntries. RegistryEntrySets can be either:

Link copied to clipboard
sealed interface TagBuilder<T : Keyed, E : RegistryEntry<T>, S : RegistryEntrySet<T>>

A builder for creating or modifying the entries of a tag in a pre-flattened state.

Properties

Link copied to clipboard
val ALL_REGISTRY_KEYS: Set<RegistryKey<*>>

A set of all RegistryKeys.

Link copied to clipboard
val PotPatternType.entry: RegistryEntry.Paper<PotPatternType>

Gets the registry entry for this PotPatternType in RegistryKey.DECORATED_POT_PATTERN.

val DataComponentType.entry: RegistryEntry.Paper<DataComponentType>

Gets the registry entry for this DataComponentType in RegistryKey.DATA_COMPONENT_TYPE.

val PoiType.entry: RegistryEntry.Paper<PoiType>

Gets the registry entry for this PoiType in RegistryKey.POINT_OF_INTEREST_TYPE.

val Fluid.entry: RegistryEntry.Paper<Fluid>

Gets the registry entry for this Fluid in RegistryKey.FLUID.

val GameEvent.entry: RegistryEntry.Paper<GameEvent>

Gets the registry entry for this GameEvent in RegistryKey.GAME_EVENT.

val GameRule<*>.entry: RegistryEntry.Paper<GameRule<*>>

Gets the registry entry for this GameRule in RegistryKey.GAME_RULE.

val JukeboxSong.entry: RegistryEntry.Paper<JukeboxSong>

Gets the registry entry for this JukeboxSong in RegistryKey.JUKEBOX_SONG.

val Particle.entry: RegistryEntry.Paper<Particle>

Gets the registry entry for this Particle in RegistryKey.PARTICLE_TYPE.

val Attribute.entry: RegistryEntry.Paper<Attribute>

Gets the registry entry for this Attribute in RegistryKey.ATTRIBUTE.

val Biome.entry: RegistryEntry.Paper<Biome>

Gets the registry entry for this Biome in RegistryKey.BIOME.

val BlockType.entry: RegistryEntry.Paper<BlockType>

Gets the registry entry for this BlockType in RegistryKey.BLOCK.

val DamageType.entry: RegistryEntry.Paper<DamageType>

Gets the registry entry for this DamageType in RegistryKey.DAMAGE_TYPE.

val Enchantment.entry: RegistryEntry.Paper<Enchantment>

Gets the registry entry for this Enchantment in RegistryKey.ENCHANTMENT.

val Cat.SoundVariant.entry: RegistryEntry.Paper<Cat.SoundVariant>

Gets the registry entry for this Cat.SoundVariant in RegistryKey.CAT_SOUND_VARIANT.

val Cat.Type.entry: RegistryEntry.Paper<Cat.Type>

Gets the registry entry for this Cat.Type in RegistryKey.CAT_VARIANT.

val Chicken.SoundVariant.entry: RegistryEntry.Paper<Chicken.SoundVariant>

Gets the registry entry for this Chicken.SoundVariant in RegistryKey.CHICKEN_SOUND_VARIANT.

val Chicken.Variant.entry: RegistryEntry.Paper<Chicken.Variant>

Gets the registry entry for this Chicken.Variant in RegistryKey.CHICKEN_VARIANT.

val Cow.SoundVariant.entry: RegistryEntry.Paper<Cow.SoundVariant>

Gets the registry entry for this Cow.SoundVariant in RegistryKey.COW_SOUND_VARIANT.

val Cow.Variant.entry: RegistryEntry.Paper<Cow.Variant>

Gets the registry entry for this Cow.Variant in RegistryKey.COW_VARIANT.

val EntityType.entry: RegistryEntry.Paper<EntityType>

Gets the registry entry for this EntityType in RegistryKey.ENTITY_TYPE.

val Frog.Variant.entry: RegistryEntry.Paper<Frog.Variant>

Gets the registry entry for this Frog.Variant in RegistryKey.FROG_VARIANT.

val Pig.SoundVariant.entry: RegistryEntry.Paper<Pig.SoundVariant>

Gets the registry entry for this Pig.SoundVariant in RegistryKey.PIG_SOUND_VARIANT.

val Pig.Variant.entry: RegistryEntry.Paper<Pig.Variant>

Gets the registry entry for this Pig.Variant in RegistryKey.PIG_VARIANT.

val SulfurCube.Archetype.entry: RegistryEntry.Paper<SulfurCube.Archetype>

Gets the registry entry for this SulfurCube.Archetype in RegistryKey.SULFUR_CUBE_ARCHETYPE.

val Villager.Profession.entry: RegistryEntry.Paper<Villager.Profession>

Gets the registry entry for this Villager.Profession in RegistryKey.VILLAGER_PROFESSION.

val Villager.Type.entry: RegistryEntry.Paper<Villager.Type>

Gets the registry entry for this Villager.Type in RegistryKey.VILLAGER_TYPE.

val Wolf.SoundVariant.entry: RegistryEntry.Paper<Wolf.SoundVariant>

Gets the registry entry for this Wolf.SoundVariant in RegistryKey.WOLF_SOUND_VARIANT.

val Wolf.Variant.entry: RegistryEntry.Paper<Wolf.Variant>

Gets the registry entry for this Wolf.Variant in RegistryKey.WOLF_VARIANT.

val ZombieNautilus.Variant.entry: RegistryEntry.Paper<ZombieNautilus.Variant>

Gets the registry entry for this ZombieNautilus.Variant in RegistryKey.ZOMBIE_NAUTILUS_VARIANT.

val MemoryKey<*>.entry: RegistryEntry.Paper<MemoryKey<*>>

Gets the registry entry for this MemoryKey in RegistryKey.MEMORY_MODULE_TYPE.

val StructureType.entry: RegistryEntry.Paper<StructureType>

Gets the registry entry for this StructureType in RegistryKey.STRUCTURE_TYPE.

val ItemType.entry: RegistryEntry.Paper<ItemType>

Gets the registry entry for this ItemType in RegistryKey.ITEM.

val MenuType.entry: RegistryEntry.Paper<MenuType>

Gets the registry entry for this MenuType in RegistryKey.MENU.

val MapCursor.Type.entry: RegistryEntry.Paper<MapCursor.Type>

Gets the registry entry for this MapCursor.Type in RegistryKey.MAP_DECORATION_TYPE.

val PotionEffectType.entry: RegistryEntry.Paper<PotionEffectType>

Gets the registry entry for this PotionEffectType in RegistryKey.MOB_EFFECT.

val PotionType.entry: RegistryEntry.Paper<PotionType>

Gets the registry entry for this PotionType in RegistryKey.POTION.

Link copied to clipboard
val Dialog.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Dialog>>>

Gets the tags that contain this Dialog.

val PoiType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<PoiType>>>

Gets the tags that contain this PoiType.

val Art.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Art>>>

Gets the tags that contain this Art.

val Fluid.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Fluid>>>

Gets the tags that contain this Fluid.

val GameEvent.tags: Provider<Set<RegistryEntrySet.Paper.Tag<GameEvent>>>

Gets the tags that contain this GameEvent.

val MusicInstrument.tags: Provider<Set<RegistryEntrySet.Paper.Tag<MusicInstrument>>>

Gets the tags that contain this MusicInstrument.

val Biome.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Biome>>>

Gets the tags that contain this Biome.

val BlockType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<BlockType>>>

Gets the tags that contain this BlockType.

val PatternType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<PatternType>>>

Gets the tags that contain this PatternType.

val DamageType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<DamageType>>>

Gets the tags that contain this DamageType.

val Enchantment.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Enchantment>>>

Gets the tags that contain this Enchantment.

val EntityType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<EntityType>>>

Gets the tags that contain this EntityType.

val Structure.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Structure>>>

Gets the tags that contain this Structure.

val ItemType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<ItemType>>>

Gets the tags that contain this ItemType.

val PotionType.tags: Provider<Set<RegistryEntrySet.Paper.Tag<PotionType>>>

Gets the tags that contain this PotionType.

@get:JvmName(name = "getDialogEntryTags")
val RegistryEntry.Paper<Dialog>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Dialog>>>

Gets the tags that contain this Dialog entry.

@get:JvmName(name = "getPoiTypeEntryTags")
val RegistryEntry.Paper<PoiType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<PoiType>>>

Gets the tags that contain this PoiType entry.

@get:JvmName(name = "getArtEntryTags")
val RegistryEntry.Paper<Art>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Art>>>

Gets the tags that contain this Art entry.

@get:JvmName(name = "getFluidEntryTags")
val RegistryEntry.Paper<Fluid>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Fluid>>>

Gets the tags that contain this Fluid entry.

@get:JvmName(name = "getGameEventEntryTags")
val RegistryEntry.Paper<GameEvent>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<GameEvent>>>

Gets the tags that contain this GameEvent entry.

@get:JvmName(name = "getMusicInstrumentEntryTags")
val RegistryEntry.Paper<MusicInstrument>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<MusicInstrument>>>

Gets the tags that contain this MusicInstrument entry.

@get:JvmName(name = "getBiomeEntryTags")
val RegistryEntry.Paper<Biome>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Biome>>>

Gets the tags that contain this Biome entry.

@get:JvmName(name = "getBlockTypeEntryTags")
val RegistryEntry.Paper<BlockType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<BlockType>>>

Gets the tags that contain this BlockType entry.

@get:JvmName(name = "getPatternTypeEntryTags")
val RegistryEntry.Paper<PatternType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<PatternType>>>

Gets the tags that contain this PatternType entry.

@get:JvmName(name = "getDamageTypeEntryTags")
val RegistryEntry.Paper<DamageType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<DamageType>>>

Gets the tags that contain this DamageType entry.

@get:JvmName(name = "getEnchantmentEntryTags")
val RegistryEntry.Paper<Enchantment>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Enchantment>>>

Gets the tags that contain this Enchantment entry.

@get:JvmName(name = "getEntityTypeEntryTags")
val RegistryEntry.Paper<EntityType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<EntityType>>>

Gets the tags that contain this EntityType entry.

@get:JvmName(name = "getStructureEntryTags")
val RegistryEntry.Paper<Structure>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<Structure>>>

Gets the tags that contain this Structure entry.

@get:JvmName(name = "getItemTypeEntryTags")
val RegistryEntry.Paper<ItemType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<ItemType>>>

Gets the tags that contain this ItemType entry.

@get:JvmName(name = "getPotionTypeEntryTags")
val RegistryEntry.Paper<PotionType>.tags: Provider<Set<RegistryEntrySet.Paper.Tag<PotionType>>>

Gets the tags that contain this PotionType entry.

Link copied to clipboard
val PotPatternType.typedKey: TypedKey<PotPatternType>

Gets the typed key for this PotPatternType in RegistryKey.DECORATED_POT_PATTERN.

val DataComponentType.typedKey: TypedKey<DataComponentType>

Gets the typed key for this DataComponentType in RegistryKey.DATA_COMPONENT_TYPE.

val PoiType.typedKey: TypedKey<PoiType>

Gets the typed key for this PoiType in RegistryKey.POINT_OF_INTEREST_TYPE.

val Fluid.typedKey: TypedKey<Fluid>

Gets the typed key for this Fluid in RegistryKey.FLUID.

val GameEvent.typedKey: TypedKey<GameEvent>

Gets the typed key for this GameEvent in RegistryKey.GAME_EVENT.

val GameRule<*>.typedKey: TypedKey<GameRule<*>>

Gets the typed key for this GameRule in RegistryKey.GAME_RULE.

val JukeboxSong.typedKey: TypedKey<JukeboxSong>

Gets the typed key for this JukeboxSong in RegistryKey.JUKEBOX_SONG.

val Particle.typedKey: TypedKey<Particle>

Gets the typed key for this Particle in RegistryKey.PARTICLE_TYPE.

val Attribute.typedKey: TypedKey<Attribute>

Gets the typed key for this Attribute in RegistryKey.ATTRIBUTE.

val Biome.typedKey: TypedKey<Biome>

Gets the typed key for this Biome in RegistryKey.BIOME.

val BlockType.typedKey: TypedKey<BlockType>

Gets the typed key for this BlockType in RegistryKey.BLOCK.

val DamageType.typedKey: TypedKey<DamageType>

Gets the typed key for this DamageType in RegistryKey.DAMAGE_TYPE.

val Enchantment.typedKey: TypedKey<Enchantment>

Gets the typed key for this Enchantment in RegistryKey.ENCHANTMENT.

val Cat.SoundVariant.typedKey: TypedKey<Cat.SoundVariant>

Gets the typed key for this Cat.SoundVariant in RegistryKey.CAT_SOUND_VARIANT.

val Cat.Type.typedKey: TypedKey<Cat.Type>

Gets the typed key for this Cat.Type in RegistryKey.CAT_VARIANT.

val Chicken.SoundVariant.typedKey: TypedKey<Chicken.SoundVariant>

Gets the typed key for this Chicken.SoundVariant in RegistryKey.CHICKEN_SOUND_VARIANT.

val Chicken.Variant.typedKey: TypedKey<Chicken.Variant>

Gets the typed key for this Chicken.Variant in RegistryKey.CHICKEN_VARIANT.

val Cow.SoundVariant.typedKey: TypedKey<Cow.SoundVariant>

Gets the typed key for this Cow.SoundVariant in RegistryKey.COW_SOUND_VARIANT.

val Cow.Variant.typedKey: TypedKey<Cow.Variant>

Gets the typed key for this Cow.Variant in RegistryKey.COW_VARIANT.

val EntityType.typedKey: TypedKey<EntityType>

Gets the typed key for this EntityType in RegistryKey.ENTITY_TYPE.

val Frog.Variant.typedKey: TypedKey<Frog.Variant>

Gets the typed key for this Frog.Variant in RegistryKey.FROG_VARIANT.

val Pig.SoundVariant.typedKey: TypedKey<Pig.SoundVariant>

Gets the typed key for this Pig.SoundVariant in RegistryKey.PIG_SOUND_VARIANT.

val Pig.Variant.typedKey: TypedKey<Pig.Variant>

Gets the typed key for this Pig.Variant in RegistryKey.PIG_VARIANT.

val SulfurCube.Archetype.typedKey: TypedKey<SulfurCube.Archetype>

Gets the typed key for this SulfurCube.Archetype in RegistryKey.SULFUR_CUBE_ARCHETYPE.

val Villager.Profession.typedKey: TypedKey<Villager.Profession>

Gets the typed key for this Villager.Profession in RegistryKey.VILLAGER_PROFESSION.

val Villager.Type.typedKey: TypedKey<Villager.Type>

Gets the typed key for this Villager.Type in RegistryKey.VILLAGER_TYPE.

val Wolf.SoundVariant.typedKey: TypedKey<Wolf.SoundVariant>

Gets the typed key for this Wolf.SoundVariant in RegistryKey.WOLF_SOUND_VARIANT.

val Wolf.Variant.typedKey: TypedKey<Wolf.Variant>

Gets the typed key for this Wolf.Variant in RegistryKey.WOLF_VARIANT.

val ZombieNautilus.Variant.typedKey: TypedKey<ZombieNautilus.Variant>

Gets the typed key for this ZombieNautilus.Variant in RegistryKey.ZOMBIE_NAUTILUS_VARIANT.

val MemoryKey<*>.typedKey: TypedKey<MemoryKey<*>>

Gets the typed key for this MemoryKey in RegistryKey.MEMORY_MODULE_TYPE.

val StructureType.typedKey: TypedKey<StructureType>

Gets the typed key for this StructureType in RegistryKey.STRUCTURE_TYPE.

val ItemType.typedKey: TypedKey<ItemType>

Gets the typed key for this ItemType in RegistryKey.ITEM.

val MenuType.typedKey: TypedKey<MenuType>

Gets the typed key for this MenuType in RegistryKey.MENU.

val MapCursor.Type.typedKey: TypedKey<MapCursor.Type>

Gets the typed key for this MapCursor.Type in RegistryKey.MAP_DECORATION_TYPE.

val PotionEffectType.typedKey: TypedKey<PotionEffectType>

Gets the typed key for this PotionEffectType in RegistryKey.MOB_EFFECT.

val PotionType.typedKey: TypedKey<PotionType>

Gets the typed key for this PotionType in RegistryKey.POTION.

Functions

Link copied to clipboard
fun <T : Keyed> LifecycleEventManager<BootstrapContext>.addToExistingTags(registry: RegistryKey<T>, entriesByTag: Provider<Map<TagKey<T>, Set<TagEntry<T>>>>, priority: Int = -1)

Adds the entries in entriesByTag to their corresponding tags during pre-flatten if they exist. Does not create new tags. Non-existent tags are ignored. Changes to entriesByTag cause a data reload.

Link copied to clipboard
fun <T, R> Provider<T>.bootstrapFlatMap(transform: (T) -> Provider<R>): Provider<R>

Flat-maps the value of this provider via transform. During bootstrap phase, uses Provider.flatMap, otherwise Provider.immediateFlatMap. This allows creating flat-mapped providers based off of RegistryEntries lazily during bootstrap phase, where resolving their value is not possible, without paying for the extra overhead post-bootstrap, where immediateFlatMap can be used.

Link copied to clipboard
fun <T> Provider<Provider<T>>.bootstrapFlatten(): Provider<T>

Flattens the value of this provider. During bootstrap phase, uses Provider.flatMap, otherwise Provider.immediateFlatMap. This allows creating flat-mapped providers based off of RegistryEntries lazily during bootstrap phase, where resolving their value is not possible, without paying for the extra overhead post-bootstrap, where immediateFlatMap can be used.

Link copied to clipboard

Builds a provider of NovaTagEntry sets using the given build function.

Link copied to clipboard
fun <T : Keyed> LifecycleEventManager<BootstrapContext>.createOrModifyTag(tag: TagKey<T>, priority: Int = 0, modify: TagBuilder.Paper<T>.() -> Unit)

Registers a pre-flatten LifecycleEvents.TAGS handler that applies modify to tag, creating a new tag if it does not exist yet. The builder is run again on every tag reload. Changes to providers supplied to this builder cause a data reload.

Link copied to clipboard

Returns an empty RegistryEntrySet.

fun <T : Keyed> emptyRegistryEntrySet(registry: RegistryKey<T>): RegistryEntrySet.Paper.Direct<T>

Returns an empty RegistryEntrySet.Paper.Direct for the given registry.

Returns an empty RegistryEntrySet.Nova.Direct for the given registry.

Link copied to clipboard
fun <T : NovaRegistryElement<T>> MutableNovaRegistry(key: Key, reloadable: Boolean, unknownEntryFactory: (RegistryEntry.Nova<T>) -> T? = null): MutableNovaRegistry<T>

Creates a new, possibly reloadable, MutableNovaRegistry identified by key that may use unknownEntryFactory to create values for unregistered keys.

Link copied to clipboard
fun <T : Keyed> optionalRegistryEntrySetOf(tagKey: TagKey<T>, registryAccess: RegistryAccess = RegistryAccess.registryAccess()): Provider<RegistryEntrySet.Paper.Tag<T>?>

Returns a provider of an RegistryEntrySet.Paper.Tag for the given tagKey, resolving from registryAccess, or null if the tag doesn't exist in the registry.

Link copied to clipboard

Returns a RegistryEntrySet.Nova containing elements.

Returns a RegistryEntrySet.Paper containing elements.

fun <T : Keyed> registryEntrySetOf(registryKey: RegistryKey<T>, registryAccess: RegistryAccess = RegistryAccess.registryAccess()): RegistryEntrySet.Paper.Tag<T>

Returns a RegistryEntrySet.Paper.Tag for all entries in the given registryKey, resolving from registryAccess. This uses a fake tag key using the registry key, which is not actually present in the registry.

fun <T : Keyed> registryEntrySetOf(tagKey: TagKey<T>, registryAccess: RegistryAccess = RegistryAccess.registryAccess()): RegistryEntrySet.Paper.Tag<T>

Returns a RegistryEntrySet.Paper.Tag for the given tagKey, resolving from registryAccess.

fun <T : Keyed> registryEntrySetOf(keys: Iterable<TypedKey<T>>, registryAccess: RegistryAccess = RegistryAccess.registryAccess()): RegistryEntrySet.Paper.Direct<T>

Returns a RegistryEntrySet.Paper for the given keys, resolving from registryAccess.

Returns a RegistryEntrySet.Nova containing (element, elements).

Returns a RegistryEntrySet.Paper containing (element, elements).

fun <T : Keyed> registryEntrySetOf(key: TypedKey<T>, vararg keys: TypedKey<T>, registryAccess: RegistryAccess = RegistryAccess.registryAccess()): RegistryEntrySet.Paper.Direct<T>

Returns a RegistryEntrySet.Paper from the given (key, keys), resolving from registryAccess.