Package net.minecraft.util.registry
Class DynamicRegistryManager
java.lang.Object
net.minecraft.util.registry.DynamicRegistryManager
- Direct Known Subclasses:
DynamicRegistryManager.Impl
public abstract class DynamicRegistryManager extends Object
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 go
intermediary net/minecraft/class_5455
named net/minecraft/util/registry/DynamicRegistryManager
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
DynamicRegistryManager.Impl
An immutable implementation of the dynamic registry manager, representing a specialized configuration of registries.(package private) static class
DynamicRegistryManager.Info<E>
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
Fields Modifier and Type Field Description private static DynamicRegistryManager.Impl
BUILTIN
private static Map<RegistryKey<? extends Registry<?>>,DynamicRegistryManager.Info<?>>
INFOS
private static Logger
LOGGER
-
Constructor Summary
Constructors Constructor Description DynamicRegistryManager()
-
Method Summary
Modifier and Type Method Description private 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.<E> MutableRegistry<E>
getMutable(RegistryKey<? extends Registry<? extends E>> key)
<E> Optional<? extends Registry<E>>
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.Impl manager, DynamicRegistryManager.Info<E> info)
Loads elements from theops
into the registry specified byinfo
within themanager
.static void
load(DynamicRegistryManager.Impl registryManager, RegistryOps<?> registryOps)
Loads a dynamic registry manager from the resource manager's data files.private static <E> void
method_31141(DynamicRegistryManager.Impl registryManager, RegistryOps.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
Lgo;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
Lgo;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
Lgo;c:Lgo$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
Lgo;a(Lwa;)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
Lgo;b(Lwa;)Lgt;
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
Lgo;c(Lwa;)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
Lgo;d(Lwa;)Lgn;
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
Lgo;a(Lcom/google/common/collect/ImmutableMap$Builder;Lwa;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
Lgo;a(Lcom/google/common/collect/ImmutableMap$Builder;Lwa;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
-
create
Creates a default dynamic registry manager.- Mappings:
Namespace Name Mixin selector official a
Lgo;a()Lgo$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, RegistryOps.EntryLoader.Impl entryLoader, DynamicRegistryManager.Info<E> info)- Mappings:
Namespace Name Mixin selector official a
Lgo;a(Lgo$b;Lvy$b$a;Lgo$a;)V
intermediary method_31141
Lnet/minecraft/class_5455;method_31141(Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5382$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/RegistryOps$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
Lgo;a(Lgo$b;Lwa;)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
Lgo;a(Lgo$b;Lgn;)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
Lgo;a(Lgo$b;Lvy;)V
intermediary method_30519
Lnet/minecraft/class_5455;method_30519(Lnet/minecraft/class_5455$class_5457;Lnet/minecraft/class_5382;)V
named load
Lnet/minecraft/util/registry/DynamicRegistryManager;load(Lnet/minecraft/util/registry/DynamicRegistryManager$Impl;Lnet/minecraft/util/dynamic/RegistryOps;)V
-
load
private static <E> void load(RegistryOps<?> ops, DynamicRegistryManager.Impl manager, 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
Lgo;a(Lvy;Lgo$b;Lgo$a;)V
intermediary method_30526
Lnet/minecraft/class_5455;method_30526(Lnet/minecraft/class_5382;Lnet/minecraft/class_5455$class_5457;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$Impl;Lnet/minecraft/util/registry/DynamicRegistryManager$Info;)V
-