Package net.minecraft.util.registry
Class DynamicRegistryManager
java.lang.Object
net.minecraft.util.registry.DynamicRegistryManager
- Direct Known Subclasses:
DynamicRegistryManager.Impl
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 DynamicRegistryManager.Impl
class serves as an immutable implementation of any particular collection
or configuration of dynamic registries.
- Mappings:
Namespace Name official gy
intermediary net/minecraft/class_5455
named net/minecraft/util/registry/DynamicRegistryManager
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
An immutable implementation of the dynamic registry manager, representing a specialized configuration of registries.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. -
Field Summary
Modifier and TypeFieldDescriptionprivate static final DynamicRegistryManager.Impl
(package private) static final Map<RegistryKey<? extends Registry<?>>,
DynamicRegistryManager.Info<?>> (package private) static final Logger
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprivate static <E> void
addBuiltinEntries
(DynamicRegistryManager.Impl manager, Registry<E> registry) Add all entries of theregistry
to the corresponding registry within this manager.private static <R extends Registry<?>>
voidcopyFromBuiltin
(DynamicRegistryManager.Impl manager, RegistryKey<R> registryRef) Add all entries of the registry referred byregistryRef
to the corresponding registry within this manager.static DynamicRegistryManager.Impl
create()
Creates a default dynamic registry manager.<E> Registry<E>
get
(RegistryKey<? extends Registry<? extends E>> key) Retrieves a registry from this manager, or throws an exception when the registry does not exist.static Iterable<DynamicRegistryManager.Info<?>>
getInfos()
<E> MutableRegistry<E>
getMutable
(RegistryKey<? extends Registry<? extends E>> key) getOptional
(RegistryKey<? extends Registry<? extends E>> key) abstract <E> Optional<MutableRegistry<E>>
getOptionalMutable
(RegistryKey<? extends Registry<? extends E>> key) Retrieves a registry optionally from this manager.private static <E> void
load
(RegistryOps<?> ops, DynamicRegistryManager dynamicRegistryManager, DynamicRegistryManager.Info<E> info) Loads elements from theops
into the registry specified byinfo
within themanager
.static void
load
(DynamicRegistryManager dynamicRegistryManager, RegistryOps<?> registryOps) Loads a dynamic registry manager from the resource manager's data files.private static <E> void
method_31141
(DynamicRegistryManager.Impl registryManager, EntryLoader.Impl entryLoader, DynamicRegistryManager.Info<E> info) 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)
-
Field Details
-
LOGGER
- Mappings:
Namespace Name Mixin selector official a
Lgy;a:Lorg/apache/logging/log4j/Logger;
intermediary field_25918
Lnet/minecraft/class_5455;field_25918:Lorg/apache/logging/log4j/Logger;
named LOGGER
Lnet/minecraft/util/registry/DynamicRegistryManager;LOGGER:Lorg/apache/logging/log4j/Logger;
-
INFOS
- Mappings:
Namespace Name Mixin selector official b
Lgy;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;
-
BUILTIN
- Mappings:
Namespace Name Mixin selector official c
Lgy;c:Lgy$b;
intermediary field_26733
Lnet/minecraft/class_5455;field_26733:Lnet/minecraft/class_5455$class_5457;
named BUILTIN
Lnet/minecraft/util/registry/DynamicRegistryManager;BUILTIN:Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;
-
-
Constructor Details
-
DynamicRegistryManager
public DynamicRegistryManager()
-
-
Method Details
-
getOptionalMutable
public abstract <E> Optional<MutableRegistry<E>> getOptionalMutable(RegistryKey<? extends Registry<? extends E>> key) Retrieves a registry optionally from this manager.- Mappings:
Namespace Name Mixin selector official a
Lgy;a(Lya;)Ljava/util/Optional;
intermediary method_30527
Lnet/minecraft/class_5455;method_30527(Lnet/minecraft/class_5321;)Ljava/util/Optional;
named getOptionalMutable
Lnet/minecraft/util/registry/DynamicRegistryManager;getOptionalMutable(Lnet/minecraft/util/registry/RegistryKey;)Ljava/util/Optional;
-
getMutable
- Mappings:
Namespace Name Mixin selector official b
Lgy;b(Lya;)Lhd;
intermediary method_33309
Lnet/minecraft/class_5455;method_33309(Lnet/minecraft/class_5321;)Lnet/minecraft/class_2385;
named getMutable
Lnet/minecraft/util/registry/DynamicRegistryManager;getMutable(Lnet/minecraft/util/registry/RegistryKey;)Lnet/minecraft/util/registry/MutableRegistry;
-
getOptional
public <E> Optional<? extends Registry<E>> getOptional(RegistryKey<? extends Registry<? extends E>> key) - Mappings:
Namespace Name Mixin selector official c
Lgy;c(Lya;)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, 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
Lgy;d(Lya;)Lgx;
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
Lgy;a(Lcom/google/common/collect/ImmutableMap$Builder;Lya;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
Lgy;a(Lcom/google/common/collect/ImmutableMap$Builder;Lya;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
Lgy;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;
-
create
Creates a default dynamic registry manager.- Mappings:
Namespace Name Mixin selector official b
Lgy;b()Lgy$b;
intermediary method_30528
Lnet/minecraft/class_5455;method_30528()Lnet/minecraft/class_5455$class_5457;
named create
Lnet/minecraft/util/registry/DynamicRegistryManager;create()Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;
-
method_31141
private static <E> void method_31141(DynamicRegistryManager.Impl registryManager, EntryLoader.Impl entryLoader, DynamicRegistryManager.Info<E> info) - Mappings:
Namespace Name Mixin selector official a
Lgy;a(Lgy$b;Lxy$a;Lgy$a;)V
intermediary method_31141
Lnet/minecraft/class_5455;method_31141(Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5506$class_5507;Lnet/minecraft/class_5455$class_5456;)V
named method_31141
Lnet/minecraft/util/registry/DynamicRegistryManager;method_31141(Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;Lnet/minecraft/util/dynamic/EntryLoader$Impl;Lnet/minecraft/util/registry/DynamicRegistryManager$Info;)V
-
copyFromBuiltin
private static <R extends Registry<?>> void copyFromBuiltin(DynamicRegistryManager.Impl manager, RegistryKey<R> registryRef) Add all entries of the registry referred byregistryRef
to the corresponding registry within this manager.- Mappings:
Namespace Name Mixin selector official a
Lgy;a(Lgy$b;Lya;)V
intermediary method_30525
Lnet/minecraft/class_5455;method_30525(Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5321;)V
named copyFromBuiltin
Lnet/minecraft/util/registry/DynamicRegistryManager;copyFromBuiltin(Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;Lnet/minecraft/util/registry/RegistryKey;)V
-
addBuiltinEntries
private static <E> void addBuiltinEntries(DynamicRegistryManager.Impl manager, Registry<E> registry) Add all entries of theregistry
to the corresponding registry within this manager.- Mappings:
Namespace Name Mixin selector official a
Lgy;a(Lgy$b;Lgx;)V
intermediary method_30524
Lnet/minecraft/class_5455;method_30524(Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_2378;)V
named addBuiltinEntries
Lnet/minecraft/util/registry/DynamicRegistryManager;addBuiltinEntries(Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;Lnet/minecraft/util/registry/Registry;)V
-
load
Loads a dynamic registry manager from the resource manager's data files.- Mappings:
Namespace Name Mixin selector official a
Lgy;a(Lgy;Lxx;)V
intermediary method_30519
Lnet/minecraft/class_5455;method_30519(Lnet/minecraft/class_5455;Lnet/minecraft/class_5382;)V
named load
Lnet/minecraft/util/registry/DynamicRegistryManager;load(Lnet/minecraft/util/registry/DynamicRegistryManager;Lnet/minecraft/util/dynamic/RegistryOps;)V
-
load
private static <E> void load(RegistryOps<?> ops, DynamicRegistryManager dynamicRegistryManager, 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
Lgy;a(Lxx;Lgy;Lgy$a;)V
intermediary method_30526
Lnet/minecraft/class_5455;method_30526(Lnet/minecraft/class_5382;Lnet/minecraft/class_5455;Lnet/minecraft/class_5455$class_5456;)V
named load
Lnet/minecraft/util/registry/DynamicRegistryManager;load(Lnet/minecraft/util/dynamic/RegistryOps;Lnet/minecraft/util/registry/DynamicRegistryManager;Lnet/minecraft/util/registry/DynamicRegistryManager$Info;)V
-