Package net.minecraft.util.registry
Interface DynamicRegistryManager
- All Known Subinterfaces:
DynamicRegistryManager.Immutable
,DynamicRegistryManager.Mutable
- All Known Implementing Classes:
DynamicRegistryManager.ImmutableImpl
,DynamicRegistryManager.MutableImpl
public interface DynamicRegistryManager
A manager of dynamic registries. It allows users to access non-hardcoded
registries reliably.
Each minecraft server has a dynamic registry manager for file-loaded registries, while each client play network handler has a dynamic registry manager for server-sent dynamic registries.
The
class serves as an immutable implementation of any particular collection
or configuration of dynamic registries.invalid @link
DynamicRegistryManager.Impl
- Mappings:
Namespace Name official hc
intermediary net/minecraft/class_5455
named net/minecraft/util/registry/DynamicRegistryManager
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic final record
static interface
static final class
static final record
Represents the serialization behavior of the registries, including the id of the registry, the codec for its elements, and whether the registry should be sent to the client.static interface
static final class
-
Field Summary
Modifier and TypeFieldDescriptionstatic final Supplier<DynamicRegistryManager.Immutable>
static final com.mojang.serialization.Codec<DynamicRegistryManager>
static final Map<RegistryKey<? extends Registry<?>>,
DynamicRegistryManager.Info<?>> static final org.slf4j.Logger
-
Method Summary
Modifier and TypeMethodDescriptionprivate static <E> void
addEntriesToLoad
(EntryLoader.Impl entryLoader, DynamicRegistryManager.Info<E> info) private static <E> com.mojang.serialization.Codec<DynamicRegistryManager>
private static <K extends RegistryKey<? extends Registry<?>>,
V extends Registry<?>>
com.mojang.serialization.Codec<DynamicRegistryManager>createCodec
(com.mojang.serialization.codecs.UnboundedMapCodec<K, V> originalCodec) static DynamicRegistryManager
createDynamicRegistryManager
(com.mojang.serialization.Dynamic<?> dynamic) private static Map<RegistryKey<? extends Registry<?>>,
? extends MutableRegistry<?>> private static DynamicRegistryManager.Mutable
static <E> Registry<E>
createRegistry
(RegistryKey<? extends Registry<? extends E>> registryRef, com.mojang.serialization.Dynamic<?> dynamic) static <E> MutableRegistry<?>
createSimpleRegistry
(RegistryKey<? extends Registry<?>> registryRef) default <E> Registry<E>
get
(RegistryKey<? extends Registry<? extends E>> key) Retrieves a registry from this manager orRegistry.REGISTRIES
, or throws an exception when the registry does not exist.static Iterable<DynamicRegistryManager.Info<?>>
getInfos()
default <E> Registry<E>
getManaged
(RegistryKey<? extends Registry<? extends E>> key) Retrieves a registry from this manager, or throws an exception when the registry does not exist.private static <E> com.mojang.serialization.DataResult<? extends com.mojang.serialization.Codec<E>>
getNetworkEntryCodec
(RegistryKey<? extends Registry<E>> registryKey) getOptional
(RegistryKey<? extends Registry<? extends E>> key) getOptionalManaged
(RegistryKey<? extends Registry<? extends E>> key) Retrieves a registry optionally from this manager.default com.mojang.serialization.Lifecycle
private static <E> void
load
(com.mojang.serialization.DynamicOps<JsonElement> ops, RegistryLoader.LoaderAccess loaderAccess, DynamicRegistryManager.Info<E> info) Loads elements from theops
into the registry specified byinfo
within themanager
.static void
load
(DynamicRegistryManager.Mutable dynamicRegistryManager, com.mojang.serialization.DynamicOps<JsonElement> ops, RegistryLoader registryLoader) Loads a dynamic registry manager from the resource manager's data files.private static <E> void
register
(ImmutableMap.Builder<RegistryKey<? extends Registry<?>>, DynamicRegistryManager.Info<?>> infosBuilder, RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> entryCodec) private static <E> void
register
(ImmutableMap.Builder<RegistryKey<? extends Registry<?>>, DynamicRegistryManager.Info<?>> infosBuilder, RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> entryCodec, com.mojang.serialization.Codec<E> networkEntryCodec) default Stream<DynamicRegistryManager.Entry<?>>
private static Stream<DynamicRegistryManager.Entry<Object>>
private Stream<DynamicRegistryManager.Entry<?>>
default Stream<DynamicRegistryManager.Entry<?>>
default DynamicRegistryManager.Immutable
-
Field Details
-
LOGGER
static final org.slf4j.Logger LOGGER- Mappings:
Namespace Name Mixin selector official a
Lhc;a:Lorg/slf4j/Logger;
intermediary field_25918
Lnet/minecraft/class_5455;field_25918:Lorg/slf4j/Logger;
named LOGGER
Lnet/minecraft/util/registry/DynamicRegistryManager;LOGGER:Lorg/slf4j/Logger;
-
INFOS
- Mappings:
Namespace Name Mixin selector official b
Lhc;b:Ljava/util/Map;
intermediary field_25919
Lnet/minecraft/class_5455;field_25919:Ljava/util/Map;
named INFOS
Lnet/minecraft/util/registry/DynamicRegistryManager;INFOS:Ljava/util/Map;
-
CODEC
- Mappings:
Namespace Name Mixin selector official c
Lhc;c:Lcom/mojang/serialization/Codec;
intermediary field_36469
Lnet/minecraft/class_5455;field_36469:Lcom/mojang/serialization/Codec;
named CODEC
Lnet/minecraft/util/registry/DynamicRegistryManager;CODEC:Lcom/mojang/serialization/Codec;
-
BUILTIN
- Mappings:
Namespace Name Mixin selector official d
Lhc;d:Ljava/util/function/Supplier;
intermediary field_26733
Lnet/minecraft/class_5455;field_26733:Ljava/util/function/Supplier;
named BUILTIN
Lnet/minecraft/util/registry/DynamicRegistryManager;BUILTIN:Ljava/util/function/Supplier;
-
-
Method Details
-
getOptionalManaged
Retrieves a registry optionally from this manager.- Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lys;)Ljava/util/Optional;
intermediary method_30527
Lnet/minecraft/class_5455;method_30527(Lnet/minecraft/class_5321;)Ljava/util/Optional;
named getOptionalManaged
Lnet/minecraft/util/registry/DynamicRegistryManager;getOptionalManaged(Lnet/minecraft/util/registry/RegistryKey;)Ljava/util/Optional;
-
getManaged
Retrieves a registry from this manager, or throws an exception when the registry does not exist.- Throws:
IllegalStateException
- if the registry does not exist- Mappings:
Namespace Name Mixin selector official b
Lhc;b(Lys;)Lhb;
intermediary method_33309
Lnet/minecraft/class_5455;method_33309(Lnet/minecraft/class_5321;)Lnet/minecraft/class_2378;
named getManaged
Lnet/minecraft/util/registry/DynamicRegistryManager;getManaged(Lnet/minecraft/util/registry/RegistryKey;)Lnet/minecraft/util/registry/Registry;
-
getOptional
default <E> Optional<? extends Registry<E>> getOptional(RegistryKey<? extends Registry<? extends E>> key) - Mappings:
Namespace Name Mixin selector official c
Lhc;c(Lys;)Ljava/util/Optional;
intermediary method_33310
Lnet/minecraft/class_5455;method_33310(Lnet/minecraft/class_5321;)Ljava/util/Optional;
named getOptional
Lnet/minecraft/util/registry/DynamicRegistryManager;getOptional(Lnet/minecraft/util/registry/RegistryKey;)Ljava/util/Optional;
-
get
Retrieves a registry from this manager orRegistry.REGISTRIES
, or throws an exception when the registry does not exist.- Throws:
IllegalStateException
- if the registry does not exist- Mappings:
Namespace Name Mixin selector official d
Lhc;d(Lys;)Lhb;
intermediary method_30530
Lnet/minecraft/class_5455;method_30530(Lnet/minecraft/class_5321;)Lnet/minecraft/class_2378;
named get
Lnet/minecraft/util/registry/DynamicRegistryManager;get(Lnet/minecraft/util/registry/RegistryKey;)Lnet/minecraft/util/registry/Registry;
-
register
private static <E> void register(ImmutableMap.Builder<RegistryKey<? extends Registry<?>>, DynamicRegistryManager.Info<?>> infosBuilder, RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> entryCodec) - Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lcom/google/common/collect/ImmutableMap$Builder;Lys;Lcom/mojang/serialization/Codec;)V
intermediary method_30520
Lnet/minecraft/class_5455;method_30520(Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;)V
named register
Lnet/minecraft/util/registry/DynamicRegistryManager;register(Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;)V
-
register
private static <E> void register(ImmutableMap.Builder<RegistryKey<? extends Registry<?>>, DynamicRegistryManager.Info<?>> infosBuilder, RegistryKey<? extends Registry<E>> registryRef, com.mojang.serialization.Codec<E> entryCodec, com.mojang.serialization.Codec<E> networkEntryCodec) - Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lcom/google/common/collect/ImmutableMap$Builder;Lys;Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)V
intermediary method_31060
Lnet/minecraft/class_5455;method_31060(Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)V
named register
Lnet/minecraft/util/registry/DynamicRegistryManager;register(Lcom/google/common/collect/ImmutableMap$Builder;Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Codec;Lcom/mojang/serialization/Codec;)V
-
getInfos
- Mappings:
Namespace Name Mixin selector official a
Lhc;a()Ljava/lang/Iterable;
intermediary method_39674
Lnet/minecraft/class_5455;method_39674()Ljava/lang/Iterable;
named getInfos
Lnet/minecraft/util/registry/DynamicRegistryManager;getInfos()Ljava/lang/Iterable;
-
streamManagedRegistries
Stream<DynamicRegistryManager.Entry<?>> streamManagedRegistries()- Mappings:
Namespace Name Mixin selector official b
Lhc;b()Ljava/util/stream/Stream;
intermediary method_40308
Lnet/minecraft/class_5455;method_40308()Ljava/util/stream/Stream;
named streamManagedRegistries
Lnet/minecraft/util/registry/DynamicRegistryManager;streamManagedRegistries()Ljava/util/stream/Stream;
-
streamStaticRegistries
- Mappings:
Namespace Name Mixin selector official h
Lhc;h()Ljava/util/stream/Stream;
intermediary method_40318
Lnet/minecraft/class_5455;method_40318()Ljava/util/stream/Stream;
named streamStaticRegistries
Lnet/minecraft/util/registry/DynamicRegistryManager;streamStaticRegistries()Ljava/util/stream/Stream;
-
streamAllRegistries
- Mappings:
Namespace Name Mixin selector official c
Lhc;c()Ljava/util/stream/Stream;
intermediary method_40311
Lnet/minecraft/class_5455;method_40311()Ljava/util/stream/Stream;
named streamAllRegistries
Lnet/minecraft/util/registry/DynamicRegistryManager;streamAllRegistries()Ljava/util/stream/Stream;
-
streamSyncedRegistries
- Mappings:
Namespace Name Mixin selector official d
Lhc;d()Ljava/util/stream/Stream;
intermediary method_40313
Lnet/minecraft/class_5455;method_40313()Ljava/util/stream/Stream;
named streamSyncedRegistries
Lnet/minecraft/util/registry/DynamicRegistryManager;streamSyncedRegistries()Ljava/util/stream/Stream;
-
createCodec
- Mappings:
Namespace Name Mixin selector official i
Lhc;i()Lcom/mojang/serialization/Codec;
intermediary method_40320
Lnet/minecraft/class_5455;method_40320()Lcom/mojang/serialization/Codec;
named createCodec
Lnet/minecraft/util/registry/DynamicRegistryManager;createCodec()Lcom/mojang/serialization/Codec;
-
createCodec
private static <K extends RegistryKey<? extends Registry<?>>,V extends Registry<?>> com.mojang.serialization.Codec<DynamicRegistryManager> createCodec(com.mojang.serialization.codecs.UnboundedMapCodec<K, V> originalCodec) - Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lcom/mojang/serialization/codecs/UnboundedMapCodec;)Lcom/mojang/serialization/Codec;
intermediary method_40301
Lnet/minecraft/class_5455;method_40301(Lcom/mojang/serialization/codecs/UnboundedMapCodec;)Lcom/mojang/serialization/Codec;
named createCodec
Lnet/minecraft/util/registry/DynamicRegistryManager;createCodec(Lcom/mojang/serialization/codecs/UnboundedMapCodec;)Lcom/mojang/serialization/Codec;
-
streamSyncedManagedRegistries
- Mappings:
Namespace Name Mixin selector official j
Lhc;j()Ljava/util/stream/Stream;
intermediary method_40321
Lnet/minecraft/class_5455;method_40321()Ljava/util/stream/Stream;
named streamSyncedManagedRegistries
Lnet/minecraft/util/registry/DynamicRegistryManager;streamSyncedManagedRegistries()Ljava/util/stream/Stream;
-
getNetworkEntryCodec
private static <E> com.mojang.serialization.DataResult<? extends com.mojang.serialization.Codec<E>> getNetworkEntryCodec(RegistryKey<? extends Registry<E>> registryKey) - Mappings:
Namespace Name Mixin selector official f
Lhc;f(Lys;)Lcom/mojang/serialization/DataResult;
intermediary method_40319
Lnet/minecraft/class_5455;method_40319(Lnet/minecraft/class_5321;)Lcom/mojang/serialization/DataResult;
named getNetworkEntryCodec
Lnet/minecraft/util/registry/DynamicRegistryManager;getNetworkEntryCodec(Lnet/minecraft/util/registry/RegistryKey;)Lcom/mojang/serialization/DataResult;
-
createMutableRegistries
private static Map<RegistryKey<? extends Registry<?>>,? extends MutableRegistry<?>> createMutableRegistries()- Mappings:
Namespace Name Mixin selector official k
Lhc;k()Ljava/util/Map;
intermediary method_40323
Lnet/minecraft/class_5455;method_40323()Ljava/util/Map;
named createMutableRegistries
Lnet/minecraft/util/registry/DynamicRegistryManager;createMutableRegistries()Ljava/util/Map;
-
createMutableRegistryManager
- Mappings:
Namespace Name Mixin selector official l
Lhc;l()Lhc$e;
intermediary method_40325
Lnet/minecraft/class_5455;method_40325()Lnet/minecraft/class_5455$class_6893;
named createMutableRegistryManager
Lnet/minecraft/util/registry/DynamicRegistryManager;createMutableRegistryManager()Lnet/minecraft/util/registry/DynamicRegistryManager$Mutable;
-
of
- Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lhb;)Lhc$a;
intermediary method_40302
Lnet/minecraft/class_5455;method_40302(Lnet/minecraft/class_2378;)Lnet/minecraft/class_5455$class_6890;
named of
Lnet/minecraft/util/registry/DynamicRegistryManager;of(Lnet/minecraft/util/registry/Registry;)Lnet/minecraft/util/registry/DynamicRegistryManager$Immutable;
-
createAndLoad
- Mappings:
Namespace Name Mixin selector official e
Lhc;e()Lhc$e;
intermediary method_40314
Lnet/minecraft/class_5455;method_40314()Lnet/minecraft/class_5455$class_6893;
named createAndLoad
Lnet/minecraft/util/registry/DynamicRegistryManager;createAndLoad()Lnet/minecraft/util/registry/DynamicRegistryManager$Mutable;
-
addEntriesToLoad
private static <E> void addEntriesToLoad(EntryLoader.Impl entryLoader, DynamicRegistryManager.Info<E> info) - Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lyr$a;Lhc$c;)V
intermediary method_31141
Lnet/minecraft/class_5455;method_31141(Lnet/minecraft/class_5506$class_5507;Lnet/minecraft/class_5455$class_5456;)V
named addEntriesToLoad
Lnet/minecraft/util/registry/DynamicRegistryManager;addEntriesToLoad(Lnet/minecraft/util/dynamic/EntryLoader$Impl;Lnet/minecraft/util/registry/DynamicRegistryManager$Info;)V
-
load
static void load(DynamicRegistryManager.Mutable dynamicRegistryManager, com.mojang.serialization.DynamicOps<JsonElement> ops, RegistryLoader registryLoader) Loads a dynamic registry manager from the resource manager's data files.- Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lhc$e;Lcom/mojang/serialization/DynamicOps;Lyp;)V
intermediary method_30519
Lnet/minecraft/class_5455;method_30519(Lnet/minecraft/class_5455$class_6893;Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/class_6900;)V
named load
Lnet/minecraft/util/registry/DynamicRegistryManager;load(Lnet/minecraft/util/registry/DynamicRegistryManager$Mutable;Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/util/dynamic/RegistryLoader;)V
-
load
private static <E> void load(com.mojang.serialization.DynamicOps<JsonElement> ops, RegistryLoader.LoaderAccess loaderAccess, DynamicRegistryManager.Info<E> info) Loads elements from theops
into the registry specified byinfo
within themanager
. Note that the resource manager instance is kept within theops
.- Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lcom/mojang/serialization/DynamicOps;Lyp$a;Lhc$c;)V
intermediary method_30526
Lnet/minecraft/class_5455;method_30526(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/class_6900$class_6901;Lnet/minecraft/class_5455$class_5456;)V
named load
Lnet/minecraft/util/registry/DynamicRegistryManager;load(Lcom/mojang/serialization/DynamicOps;Lnet/minecraft/util/dynamic/RegistryLoader$LoaderAccess;Lnet/minecraft/util/registry/DynamicRegistryManager$Info;)V
-
createDynamicRegistryManager
static DynamicRegistryManager createDynamicRegistryManager(com.mojang.serialization.Dynamic<?> dynamic) - Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lcom/mojang/serialization/Dynamic;)Lhc;
intermediary method_40299
Lnet/minecraft/class_5455;method_40299(Lcom/mojang/serialization/Dynamic;)Lnet/minecraft/class_5455;
named createDynamicRegistryManager
Lnet/minecraft/util/registry/DynamicRegistryManager;createDynamicRegistryManager(Lcom/mojang/serialization/Dynamic;)Lnet/minecraft/util/registry/DynamicRegistryManager;
-
createRegistry
static <E> Registry<E> createRegistry(RegistryKey<? extends Registry<? extends E>> registryRef, com.mojang.serialization.Dynamic<?> dynamic) - Mappings:
Namespace Name Mixin selector official a
Lhc;a(Lys;Lcom/mojang/serialization/Dynamic;)Lhb;
intermediary method_40307
Lnet/minecraft/class_5455;method_40307(Lnet/minecraft/class_5321;Lcom/mojang/serialization/Dynamic;)Lnet/minecraft/class_2378;
named createRegistry
Lnet/minecraft/util/registry/DynamicRegistryManager;createRegistry(Lnet/minecraft/util/registry/RegistryKey;Lcom/mojang/serialization/Dynamic;)Lnet/minecraft/util/registry/Registry;
-
createSimpleRegistry
- Mappings:
Namespace Name Mixin selector official e
Lhc;e(Lys;)Lhi;
intermediary method_40317
Lnet/minecraft/class_5455;method_40317(Lnet/minecraft/class_5321;)Lnet/minecraft/class_2385;
named createSimpleRegistry
Lnet/minecraft/util/registry/DynamicRegistryManager;createSimpleRegistry(Lnet/minecraft/util/registry/RegistryKey;)Lnet/minecraft/util/registry/MutableRegistry;
-
toImmutable
- Mappings:
Namespace Name Mixin selector official f
Lhc;f()Lhc$a;
intermediary method_40316
Lnet/minecraft/class_5455;method_40316()Lnet/minecraft/class_5455$class_6890;
named toImmutable
Lnet/minecraft/util/registry/DynamicRegistryManager;toImmutable()Lnet/minecraft/util/registry/DynamicRegistryManager$Immutable;
-
getRegistryLifecycle
default com.mojang.serialization.Lifecycle getRegistryLifecycle()- Mappings:
Namespace Name Mixin selector official g
Lhc;g()Lcom/mojang/serialization/Lifecycle;
intermediary method_41201
Lnet/minecraft/class_5455;method_41201()Lcom/mojang/serialization/Lifecycle;
named getRegistryLifecycle
Lnet/minecraft/util/registry/DynamicRegistryManager;getRegistryLifecycle()Lcom/mojang/serialization/Lifecycle;
-