Package net.minecraft.core
Interface RegistryAccess
- All Superinterfaces:
HolderLookup.Provider
,IHolderLookupProviderExtension
- All Known Subinterfaces:
RegistryAccess.Frozen
- All Known Implementing Classes:
RegistryAccess.ImmutableRegistryAccess
The root level registry, essentially a registry of registries. It is also an access point, hence the name, for other dynamic registries.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
static class
static final record
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RegistryAccess.Frozen
static final org.slf4j.Logger
-
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.serialization.Lifecycle
default RegistryAccess.Frozen
freeze()
static RegistryAccess.Frozen
fromRegistryOfRegistries
(Registry<? extends Registry<?>> pRegistryOfRegistries) default Stream
<ResourceKey<? extends Registry<?>>> default <T> Optional
<HolderLookup.RegistryLookup<T>> lookup
(ResourceKey<? extends Registry<? extends T>> pRegistryKey) registry
(ResourceKey<? extends Registry<? extends E>> pRegistryKey) Get the registry owned by this registry access by the given key.default <E> Registry
<E> registryOrThrow
(ResourceKey<? extends Registry<? extends E>> pRegistryKey) A variant ofregistry(ResourceKey)
that throws if the registry does not exist.Methods inherited from interface net.minecraft.core.HolderLookup.Provider
asGetterLookup, createSerializationContext, lookupOrThrow
Methods inherited from interface net.neoforged.neoforge.common.extensions.IHolderLookupProviderExtension
holder, holderOrThrow
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER -
EMPTY
-
-
Method Details
-
registry
Get the registry owned by this registry access by the given key. If it doesn't exist, the default registry of registries is queried instead, which contains static registries such as blocks. The returned registry can not guarantee that it is writable here, so the return type is widened toRegistry<E>
instead. -
lookup
default <T> Optional<HolderLookup.RegistryLookup<T>> lookup(ResourceKey<? extends Registry<? extends T>> pRegistryKey) - Specified by:
lookup
in interfaceHolderLookup.Provider
-
registryOrThrow
A variant ofregistry(ResourceKey)
that throws if the registry does not exist. -
registries
Stream<RegistryAccess.RegistryEntry<?>> registries() -
listRegistries
- Specified by:
listRegistries
in interfaceHolderLookup.Provider
-
fromRegistryOfRegistries
static RegistryAccess.Frozen fromRegistryOfRegistries(Registry<? extends Registry<?>> pRegistryOfRegistries) -
freeze
-
allRegistriesLifecycle
default com.mojang.serialization.Lifecycle allRegistriesLifecycle()
-