Class RegistrarManager
java.lang.Object
dev.architectury.registry.registries.RegistrarManager
Platform-agnostic wrapper of minecraft registries, should be used to register content.
-
Nested Class Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal <T> RegistrarBuilder<T>
builder
(net.minecraft.resources.ResourceLocation registryId, T... typeGetter) <T> void
forRegistry
(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Consumer<Registrar<T>> callback) Listen to registry registration, the callback is called when content should be registered.static RegistrarManager
<T> Registrar<T>
get
(net.minecraft.core.Registry<T> registry) Deprecated.<T> Registrar<T>
get
(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key) static <T> @Nullable net.minecraft.resources.ResourceLocation
getId
(T object, @Nullable net.minecraft.core.Registry<T> fallback) Deprecated.static <T> @Nullable net.minecraft.resources.ResourceLocation
getId
(T object, @Nullable net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> fallback) Forge: If the object isIForgeRegistryEntry
, use `getRegistryName`, else null Fabric: Use registrygetModId()
-
Method Details
-
get
-
get
public <T> Registrar<T> get(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key) -
get
Deprecated. -
forRegistry
public <T> void forRegistry(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Consumer<Registrar<T>> callback) Listen to registry registration, the callback is called when content should be registered. On forge, this is invoked afterRegistryEvent.Register
. On fabric, this is invoked immediately.- Type Parameters:
T
- the type of registry entry- Parameters:
key
- the key of the registrycallback
- the callback to be invoked
-
builder
@SafeVarargs public final <T> RegistrarBuilder<T> builder(net.minecraft.resources.ResourceLocation registryId, T... typeGetter) -
getId
@Nullable public static <T> @Nullable net.minecraft.resources.ResourceLocation getId(T object, @Nullable @Nullable net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> fallback) Forge: If the object isIForgeRegistryEntry
, use `getRegistryName`, else null Fabric: Use registry -
getId
@Nullable @Deprecated public static <T> @Nullable net.minecraft.resources.ResourceLocation getId(T object, @Nullable @Nullable net.minecraft.core.Registry<T> fallback) Deprecated.Forge: If the object isIForgeRegistryEntry
, use `getRegistryName`, else null Fabric: Use registry -
getModId
-