Package net.minecraft.core
Class RegistryAccess.ImmutableRegistryAccess
java.lang.Object
net.minecraft.core.RegistryAccess.ImmutableRegistryAccess
- All Implemented Interfaces:
HolderLookup.Provider
,RegistryAccess
,IHolderLookupProviderExtension
- Enclosing interface:
RegistryAccess
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.core.RegistryAccess
RegistryAccess.Frozen, RegistryAccess.ImmutableRegistryAccess, RegistryAccess.RegistryEntry<T>
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final Map
<? extends ResourceKey<? extends Registry<?>>, ? extends Registry<?>> Fields inherited from interface net.minecraft.core.RegistryAccess
EMPTY, LOGGER
-
Constructor Summary
ConstructorsConstructorDescriptionImmutableRegistryAccess
(List<? extends Registry<?>> pRegistries) ImmutableRegistryAccess
(Map<? extends ResourceKey<? extends Registry<?>>, ? extends Registry<?>> pRegistries) ImmutableRegistryAccess
(Stream<RegistryAccess.RegistryEntry<?>> pRegistries) -
Method Summary
Modifier and TypeMethodDescriptionregistry
(ResourceKey<? extends Registry<? extends E>> pRegistryKey) Get the registry owned by this registry access by the given key.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.core.HolderLookup.Provider
asGetterLookup, createSerializationContext, lookupOrThrow
Methods inherited from interface net.neoforged.neoforge.common.extensions.IHolderLookupProviderExtension
holder, holderOrThrow
Methods inherited from interface net.minecraft.core.RegistryAccess
allRegistriesLifecycle, freeze, listRegistries, lookup, registryOrThrow
-
Field Details
-
registries
-
-
Constructor Details
-
ImmutableRegistryAccess
-
ImmutableRegistryAccess
public ImmutableRegistryAccess(Map<? extends ResourceKey<? extends Registry<?>>, ? extends Registry<?>> pRegistries) -
ImmutableRegistryAccess
-
-
Method Details
-
registry
public <E> Optional<Registry<E>> registry(ResourceKey<? extends Registry<? extends E>> pRegistryKey) 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.- Specified by:
registry
in interfaceRegistryAccess
-
registries
- Specified by:
registries
in interfaceRegistryAccess
-