RegistryBuilder

interface RegistryBuilder

A utility for creating custom registries. Also includes some helper methods for interacting with registries

Author

fzzyhmstrs

Since

0.7.4

Inheritors

Functions

Link copied to clipboard
abstract fun <T : Any> build(key: RegistryKey<Registry<T>>): Registry<T>

Creates a Simple Registry.

Link copied to clipboard
abstract fun <T : Any> buildDefaulted(key: RegistryKey<Registry<T>>, defaultId: Identifier): Registry<T>

Creates a Defaulted Registry.

Link copied to clipboard
abstract fun <T : Any> buildDefaultedIntrusive(key: RegistryKey<Registry<T>>, defaultId: Identifier): Registry<T>

Creates a Defaulted Intrusive Registry.

Link copied to clipboard
abstract fun <T : Any> buildIntrusive(key: RegistryKey<Registry<T>>): Registry<T>

Creates an Intrusive Registry.

Link copied to clipboard
abstract fun <T> getEntryId(registry: Registry<T>, entry: RegistryEntry<T>): Identifier?

Helper method for optimally extracting ids out of a RegistryEntry

Link copied to clipboard
abstract fun getTagName(tagKey: TagKey<*>): Text

Returns the translated name for a tag, where available.

Link copied to clipboard
abstract fun itemGroup(): ItemGroup.Builder

Makes a blank ItemGroup.Builder for creating an item group as needed.

Link copied to clipboard
abstract fun <T> namespaceCodec(registry: Registry<T>): Codec<T>

Creates a registry value codec that allows for identifier shortcutting based on the namespace used to build this builder. Vanilla will shorten ids for the minecraft namespace (minecraft:thing to thing). This does the same thing but for the namespace provided.

Link copied to clipboard
abstract fun <T> referenceEntryCodec(registry: Registry<T>): Codec<RegistryEntry.Reference<T>>

Creates an entry codec for a registry that works with RegistryEntry.Reference directly, allowing you to work with the methods of that class directly.

Link copied to clipboard
abstract fun <T> regSupplierCodec(registry: Registry<T>): Codec<RegistryEntry<T>>

Creates a RegistryEntry codec that automatically handles RegistrySupplier properly