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 interfacestatic classstatic final record -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final RegistryAccess.Frozenstatic final org.slf4j.Logger -
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.serialization.Lifecycledefault RegistryAccess.Frozenfreeze()static RegistryAccess.FrozenfromRegistryOfRegistries(Registry<? extends Registry<?>> registryOfRegistries) default Stream<ResourceKey<? extends Registry<?>>> default <T> Optional<HolderLookup.RegistryLookup<T>> lookup(ResourceKey<? extends Registry<? extends T>> registryKey) registry(ResourceKey<? extends Registry<? extends E>> registryKey) Get the registry owned by this registry access by the given key.default <E> Registry<E> registryOrThrow(ResourceKey<? extends Registry<? extends E>> registryKey) A variant ofregistry(ResourceKey)that throws if the registry does not exist.Methods inherited from interface net.minecraft.core.HolderLookup.Provider
asGetterLookup, createSerializationContext, lookupOrThrowMethods 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>> registryKey) - Specified by:
lookupin interfaceHolderLookup.Provider
-
registryOrThrow
A variant ofregistry(ResourceKey)that throws if the registry does not exist. -
registries
Stream<RegistryAccess.RegistryEntry<?>> registries() -
listRegistries
- Specified by:
listRegistriesin interfaceHolderLookup.Provider
-
fromRegistryOfRegistries
static RegistryAccess.Frozen fromRegistryOfRegistries(Registry<? extends Registry<?>> registryOfRegistries) -
freeze
-
allRegistriesLifecycle
default com.mojang.serialization.Lifecycle allRegistriesLifecycle()
-