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 DynamicRegistryManager.ImmutableImpl class serves as an immutable implementation of any particular collection or configuration of dynamic registries.

Mappings:
Namespace Name
official hn
intermediary net/minecraft/class_5455
named net/minecraft/util/registry/DynamicRegistryManager
  • Field Details

    • LOGGER

      static final Logger LOGGER
      Mappings:
      Namespace Name Mixin selector
      official a Lhn;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

      static final Map<RegistryKey<? extends Registry<?>>,DynamicRegistryManager.Info<?>> INFOS
      Mappings:
      Namespace Name Mixin selector
      official b Lhn;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

      static final com.mojang.serialization.Codec<DynamicRegistryManager> CODEC
      Mappings:
      Namespace Name Mixin selector
      official c Lhn;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 Lhn;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

      <E> Optional<Registry<E>> getOptionalManaged(RegistryKey<? extends Registry<? extends E>> key)
      Retrieves a registry optionally from this manager.
      Mappings:
      Namespace Name Mixin selector
      official a Lhn;a(Laba;)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

      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.
      Throws:
      IllegalStateException - if the registry does not exist
      Mappings:
      Namespace Name Mixin selector
      official b Lhn;b(Laba;)Lhm;
      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 Lhn;c(Laba;)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

      default <E> Registry<E> get(RegistryKey<? extends Registry<? extends E>> key)
      Retrieves a registry from this manager or Registry.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 Lhn;d(Laba;)Lhm;
      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 Lhn;a(Lcom/google/common/collect/ImmutableMap$Builder;Laba;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 Lhn;a(Lcom/google/common/collect/ImmutableMap$Builder;Laba;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

      static Iterable<DynamicRegistryManager.Info<?>> getInfos()
      Mappings:
      Namespace Name Mixin selector
      official a Lhn;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 Lhn;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

      private static Stream<DynamicRegistryManager.Entry<Object>> streamStaticRegistries()
      Mappings:
      Namespace Name Mixin selector
      official h Lhn;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

      default Stream<DynamicRegistryManager.Entry<?>> streamAllRegistries()
      Mappings:
      Namespace Name Mixin selector
      official c Lhn;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

      default Stream<DynamicRegistryManager.Entry<?>> streamSyncedRegistries()
      Mappings:
      Namespace Name Mixin selector
      official d Lhn;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

      private static <E> com.mojang.serialization.Codec<DynamicRegistryManager> createCodec()
      Mappings:
      Namespace Name Mixin selector
      official i Lhn;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 Lhn;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

      private Stream<DynamicRegistryManager.Entry<?>> streamSyncedManagedRegistries()
      Mappings:
      Namespace Name Mixin selector
      official j Lhn;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 Lhn;f(Laba;)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 Lhn;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

      private static DynamicRegistryManager.Mutable createMutableRegistryManager()
      Mappings:
      Namespace Name Mixin selector
      official l Lhn;l()Lhn$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

      static DynamicRegistryManager.Immutable of(Registry<? extends Registry<?>> registries)
      Mappings:
      Namespace Name Mixin selector
      official a Lhn;a(Lhm;)Lhn$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

      static DynamicRegistryManager.Mutable createAndLoad()
      Mappings:
      Namespace Name Mixin selector
      official e Lhn;e()Lhn$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 Lhn;a(Laaz$b;Lhn$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 Lhn;a(Lhn$e;Lcom/mojang/serialization/DynamicOps;Laax;)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 the ops into the registry specified by info within the manager. Note that the resource manager instance is kept within the ops.
      Mappings:
      Namespace Name Mixin selector
      official a Lhn;a(Lcom/mojang/serialization/DynamicOps;Laax$a;Lhn$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 Lhn;a(Lcom/mojang/serialization/Dynamic;)Lhn;
      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 Lhn;a(Laba;Lcom/mojang/serialization/Dynamic;)Lhm;
      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

      static <E> MutableRegistry<?> createSimpleRegistry(RegistryKey<? extends Registry<?>> registryRef)
      Mappings:
      Namespace Name Mixin selector
      official e Lhn;e(Laba;)Lht;
      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

      default DynamicRegistryManager.Immutable toImmutable()
      Mappings:
      Namespace Name Mixin selector
      official f Lhn;f()Lhn$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 Lhn;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;