Class Registries
java.lang.Object
me.shedaniel.architectury.registry.Registries
Platform-agnostic wrapper of minecraft registries, should be used to register content.
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionfinal <T extends RegistryEntry<T>>
RegistryBuilder<T>builder
(net.minecraft.resources.ResourceLocation registryId, T... typeGetter) <T> void
forRegistry
(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Consumer<Registry<T>> callback) Listen to registry registration, the callback is called when content should be registered.static Registries
<T> Registry<T>
get
(net.minecraft.core.Registry<T> registry) Deprecated.<T> Registry<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.resources.ResourceKey<net.minecraft.core.Registry<T>> fallback) Forge: If the object isIForgeRegistryEntry
, use `getRegistryName`, else null Fabric: Use registrystatic <T> @Nullable net.minecraft.resources.ResourceLocation
getId
(T object, net.minecraft.core.Registry<T> fallback) Deprecated.getModId()
static <T> @Nullable net.minecraft.resources.ResourceLocation
getRegistryName
(T object) Deprecated.
-
Method Details
-
get
-
get
-
get
Deprecated. -
forRegistry
public <T> void forRegistry(net.minecraft.resources.ResourceKey<net.minecraft.core.Registry<T>> key, Consumer<Registry<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 extends RegistryEntry<T>> RegistryBuilder<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 net.minecraft.core.Registry<T> fallback) Deprecated.Forge: If the object isIForgeRegistryEntry
, use `getRegistryName`, else null Fabric: Use registry -
getRegistryName
@Nullable @Deprecated public static <T> @Nullable net.minecraft.resources.ResourceLocation getRegistryName(T object) Deprecated.Forge: If the object isIForgeRegistryEntry
, use `getRegistryName`, else null Fabric: null -
getModId
-