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 gx
intermediary net/minecraft/class_5455
named net/minecraft/util/registry/DynamicRegistryManager
  • Field Details

    • LOGGER

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

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

      private static final DynamicRegistryManager.Impl BUILTIN
      Mappings:
      Namespace Name Mixin selector
      official c Lgx;c:Lgx$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 Lgx;a(Lwv;)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

      public <E> MutableRegistry<E> getMutable(RegistryKey<? extends Registry<? extends E>> key)
      Mappings:
      Namespace Name Mixin selector
      official b Lgx;b(Lwv;)Lhc;
      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 Lgx;c(Lwv;)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

      public <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.
      Throws:
      IllegalStateException - if the registry does not exist
      Mappings:
      Namespace Name Mixin selector
      official d Lgx;d(Lwv;)Lgw;
      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 Lgx;a(Lcom/google/common/collect/ImmutableMap$Builder;Lwv;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 Lgx;a(Lcom/google/common/collect/ImmutableMap$Builder;Lwv;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

      public static DynamicRegistryManager.Impl create()
      Creates a default dynamic registry manager.
      Mappings:
      Namespace Name Mixin selector
      official a Lgx;a()Lgx$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 Lgx;a(Lgx$b;Lwt$b$a;Lgx$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 by registryRef to the corresponding registry within this manager.
      Mappings:
      Namespace Name Mixin selector
      official a Lgx;a(Lgx$b;Lwv;)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 the registry to the corresponding registry within this manager.
      Mappings:
      Namespace Name Mixin selector
      official a Lgx;a(Lgx$b;Lgw;)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

      public static void load(DynamicRegistryManager dynamicRegistryManager, RegistryOps<?> registryOps)
      Loads a dynamic registry manager from the resource manager's data files.
      Mappings:
      Namespace Name Mixin selector
      official a Lgx;a(Lgx;Lwt;)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 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 Lgx;a(Lwt;Lgx;Lgx$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