Registrar

public abstract class Registrar<TContent extends Object> extends RegistryKeyUtil<TContent>(source)

Utility class to register content to Minecraft registries.

Parameters

TContent

The type of the content to register

modId

The namespace of the content to register.

registry

The registry to register the content in

Inheritors

Constructors

Link copied to clipboard
public Registrar<TContent> Registrar<TContent extends Any>(String modId, RegistryKey<Registry<TContent>> registry)

Inherited properties

Link copied to clipboard
private final String modId
Link copied to clipboard
Link copied to clipboard

Creates a RegistryKey from the registry and namespace specified in the constructor and a given path. The path is derived from the property name (converted to camel_case).

Link copied to clipboard

Creates a TagKey from the registry and namespace specified in the constructor and a given path. The path is derived from the property name (converted to camel_case).

Functions

Link copied to clipboard
protected final RegistrySupplier<T> register<T extends TContent>(String path, Supplier<T> factory)
protected final RegistrySupplier<T> register<T extends TContent>(String path, Function1<RegistryKey<TContent>, T> factory)

Adds a content to be registered in a Minecraft registry using Architectury API.

Link copied to clipboard
protected final PropertyDelegateProvider<Registrar<TContent>, Lazy<T>> registering<T extends TContent>(Function1<RegistryKey<TContent>, T> factory)

Adds a content to be registered in a Minecraft registry using Architectury API. The path is derived from the property name (converted to camel_case).

protected final Lazy<T> registering<T extends TContent>(String path, Function1<RegistryKey<TContent>, T> factory)

Adds a content to be registered in a Minecraft registry using Architectury API.

Inherited functions

Link copied to clipboard

Gets the registry entry of the given registry key from the given registry manager or null, if it's not found.

Link copied to clipboard
protected final String getModId()
Link copied to clipboard
Link copied to clipboard

Creates a RegistryKey from the registry and namespace specified in the constructor and a given path. The path is derived from the property name (converted to camel_case).

Link copied to clipboard

Creates a TagKey from the registry and namespace specified in the constructor and a given path. The path is derived from the property name (converted to camel_case).

Link copied to clipboard
public final Identifier id(String path)

Creates an Identifier from the namespace specified in the constructor and a given path.

Link copied to clipboard
public final RegistryKey<TContent> registryKey(String path)

Creates a RegistryKey from the registry and namespace specified in the constructor and a given path.

Link copied to clipboard
public final TagKey<TContent> tagKey(String path)

Creates a TagKey from the registry and namespace specified in the constructor and a given path.