Interface Registry<T>

All Superinterfaces:
IndexedIterable<T>, Iterable<T>, com.mojang.serialization.Keyable
All Known Subinterfaces:
DefaultedRegistry<T>, MutableRegistry<T>
All Known Implementing Classes:
SimpleDefaultedRegistry, SimpleRegistry

public interface Registry<T> extends com.mojang.serialization.Keyable, IndexedIterable<T>
A registry is used to register various in-game components. Almost all parts of the game - from blocks, items, and entity types, to cat types, goat horn instruments, and structure pools - are registered in registries. Registry system allows the game to enumerate all known types of something, and to assign a unique identifier to each of those. Therefore, registering an object in the registry plays a very important role, and failure to register new instances of registerable object usually results in a bug or even a crash.

Terminologies

A registry is an object that holds the mapping between three things: the string ID, the numeric ID, and the registered value. There are many registries for different types of registerable objects, and a registry's type parameter indicates the accepted type. For example, you register your Block to Registry<Block>. It's important to note that registries themselves are registered in a "registry of registries", Registries.ROOT.

The string ID, usually just called "ID", is a human-readable Identifier that uniquely identifies the registered value in a registry. This should stay the same between two game versions, and is usually used for disk storage.

The numeric ID or raw ID is an integer assigned automatically by the registry to each registered value. This is not guaranteed to stay the same between two game versions, and is usually used for networking purposes.

The registered value, often just called "value" in the code, is the value added to the registry. The registry's type parameter determines the type of the registered value.

Each registered value can also be identified with a registry key. A registry key is a combination of the registry's ID and the registered value's ID. Using a registry key makes the type of the ID's associated value clear, as the type parameter contains the type.

A registry entry is an object holding a value that can be registered in a registry. In most cases, the value is already registered in a registry ("reference entry"), hence the name; however, it is possible to create a registry entry by direct reference ("direct entry"). This is useful for data packs, as they can define one-time use values directly without having to register them every time.

A registry entry list is a list of registry entries. This, is either a direct reference to each item, or a reference to a tag. A tag is a way to dynamically define a list of registered values. Anything registered in a registry can be tagged, and each registry holds a list of tags it recognizes.

Static and dynamic registries

There are two kinds of registries: static and dynamic.

  • A static registry is a registry whose values are hard-coded in the game and cannot be added or modified through data packs. Most registries are static. Since they cannot be modified (without mods), it is a singleton, and exists in this class. During the game bootstrap, vanilla objects are registered, after which the registry gets frozen to prohibit further changes.
  • A dynamic registry is a registry whose values can be added or replaced through data packs. A dynamic registry is bound to a server, and multiple registries for the same type of registerable object can exist during the lifetime of the game. When a player joins, the server sends the contents of the dynamic registry manager to the client, but only "network serializable" registries are sent. To access a dynamic registry, first get an instance of the dynamic registry manager, then call the DynamicRegistryManager.get(net.minecraft.registry.RegistryKey<? extends net.minecraft.registry.Registry<? extends E>>) method.

Using Registry

Reading Registry

A registry is also an IndexedIterable. Therefore, registries can be iterated using, e.g. for (Block block : Registries.BLOCK).

There are several other methods used for reading the contents of the registry:

Registering something to Registry

The steps for registration are different, depending on whether the registry is static or dynamic. For dynamic registries, data packs can usually be used to register a new value or replace one. For static registries, the game's code must be modified.

Static registries are defined in Registries, and unlike the dynamic registries, it cannot be changed after the game initialization. The game enforces this by "freezing" the registry. Attempting to register a value after freezing causes a crash, such as "Registry is already frozen". Modding APIs usually provide a way to bypass this restriction.

Use register(Registry, Identifier, Object) for registering a value to a registry.

Intrusive holders

For historical reasons, there are two types of reference registry entries. (This is different from the "direct" and "reference" registry entry types.)

  • Intrusive holders are registry entries tied to a specific registerable object at instantiation time. When instantiating those, it promises that the object is later registered - which, if broken, will result in a crash. This is used for Registries.BLOCK, Registries.ITEM, Registries.FLUID, Registries.ENTITY_TYPE, and Registries.GAME_EVENT registries.
  • Standalone holders are registry entries that are not intrusive. There is no restriction on instantiation.

When a class whose instances are registered as intrusive holders, such as Block or Item, are instantiated without registering, the game crashes with "Some intrusive holders were not added to registry" error message. This includes conditional registration. For example, the code below can cause a crash:


 Item myItem = new Item(new Item.Settings());
 if (condition) {
     Registry.register(Registries.ITEM, new Identifier("example", "bad"), myItem);
 }
 

The correct way is to make the instantiation conditional as well:


 if (condition) {
     Item myItem = new Item(new Item.Settings());
     Registry.register(Registries.ITEM, new Identifier("example", "bad"), myItem);
 }
 
Mappings:
Namespace Name
named net/minecraft/registry/Registry
intermediary net/minecraft/class_2378
official jz
  • Method Details

    • getKey

      RegistryKey<? extends Registry<T>> getKey()
      Returns the registry key that identifies this registry.
      Returns:
      the registry key that identifies this registry
      Mappings:
      Namespace Name Mixin selector
      named getKey Lnet/minecraft/registry/Registry;getKey()Lnet/minecraft/registry/RegistryKey;
      intermediary method_30517 Lnet/minecraft/class_2378;method_30517()Lnet/minecraft/class_5321;
      official d Ljz;d()Lakq;
    • getCodec

      default com.mojang.serialization.Codec<T> getCodec()
      Returns the codec for serializing T.
      Returns:
      the codec for serializing T
      Implementation Note:
      This serializes a value using the ID or (if compressed) the raw ID.
      Mappings:
      Namespace Name Mixin selector
      named getCodec Lnet/minecraft/registry/Registry;getCodec()Lcom/mojang/serialization/Codec;
      intermediary method_39673 Lnet/minecraft/class_2378;method_39673()Lcom/mojang/serialization/Codec;
      official r Ljz;r()Lcom/mojang/serialization/Codec;
    • getEntryCodec

      default com.mojang.serialization.Codec<RegistryEntry<T>> getEntryCodec()
      Returns the codec for serializing the registry entry of T.
      Returns:
      the codec for serializing the registry entry of T
      Implementation Note:
      This serializes a registry entry using the ID.
      Mappings:
      Namespace Name Mixin selector
      named getEntryCodec Lnet/minecraft/registry/Registry;getEntryCodec()Lcom/mojang/serialization/Codec;
      intermediary method_40294 Lnet/minecraft/class_2378;method_40294()Lcom/mojang/serialization/Codec;
      official s Ljz;s()Lcom/mojang/serialization/Codec;
    • getReferenceEntryCodec

      private com.mojang.serialization.Codec<RegistryEntry.Reference<T>> getReferenceEntryCodec()
      Mappings:
      Namespace Name Mixin selector
      named getReferenceEntryCodec Lnet/minecraft/registry/Registry;getReferenceEntryCodec()Lcom/mojang/serialization/Codec;
      intermediary method_57059 Lnet/minecraft/class_2378;method_57059()Lcom/mojang/serialization/Codec;
      official b Ljz;b()Lcom/mojang/serialization/Codec;
    • validateReference

      private com.mojang.serialization.DataResult<RegistryEntry.Reference<T>> validateReference(RegistryEntry<T> entry)
      Mappings:
      Namespace Name Mixin selector
      named validateReference Lnet/minecraft/registry/Registry;validateReference(Lnet/minecraft/registry/entry/RegistryEntry;)Lcom/mojang/serialization/DataResult;
      intermediary method_57061 Lnet/minecraft/class_2378;method_57061(Lnet/minecraft/class_6880;)Lcom/mojang/serialization/DataResult;
      official a Ljz;a(Ljm;)Lcom/mojang/serialization/DataResult;
    • keys

      default <U> Stream<U> keys(com.mojang.serialization.DynamicOps<U> ops)
      Specified by:
      keys in interface com.mojang.serialization.Keyable
      Mappings:
      Namespace Name Mixin selector
      named keys Lnet/minecraft/registry/Registry;keys(Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;
      intermediary keys Lnet/minecraft/class_2378;keys(Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;
      official keys Ljz;keys(Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;
    • getId

      Returns the ID assigned to value, or null if it is not registered.
      Returns:
      the ID assigned to value, or null if it is not registered
      Mappings:
      Namespace Name Mixin selector
      named getId Lnet/minecraft/registry/Registry;getId(Ljava/lang/Object;)Lnet/minecraft/util/Identifier;
      intermediary method_10221 Lnet/minecraft/class_2378;method_10221(Ljava/lang/Object;)Lnet/minecraft/class_2960;
      official b Ljz;b(Ljava/lang/Object;)Lakr;
    • getKey

      Optional<RegistryKey<T>> getKey(T entry)
      Returns the registry key of value, or an empty optional if it is not registered.
      Returns:
      the registry key of value, or an empty optional if it is not registered
      Mappings:
      Namespace Name Mixin selector
      named getKey Lnet/minecraft/registry/Registry;getKey(Ljava/lang/Object;)Ljava/util/Optional;
      intermediary method_29113 Lnet/minecraft/class_2378;method_29113(Ljava/lang/Object;)Ljava/util/Optional;
      official d Ljz;d(Ljava/lang/Object;)Ljava/util/Optional;
    • getRawId

      int getRawId(@Nullable T value)
      Specified by:
      getRawId in interface IndexedIterable<T>
      Mappings:
      Namespace Name Mixin selector
      named getRawId Lnet/minecraft/util/collection/IndexedIterable;getRawId(Ljava/lang/Object;)I
      intermediary method_10206 Lnet/minecraft/class_2359;method_10206(Ljava/lang/Object;)I
      official a Ljr;a(Ljava/lang/Object;)I
    • get

      Returns the value that is assigned key, or null if there is none.
      Returns:
      the value that is assigned key, or null if there is none
      Mappings:
      Namespace Name Mixin selector
      named get Lnet/minecraft/registry/Registry;get(Lnet/minecraft/registry/RegistryKey;)Ljava/lang/Object;
      intermediary method_29107 Lnet/minecraft/class_2378;method_29107(Lnet/minecraft/class_5321;)Ljava/lang/Object;
      official a Ljz;a(Lakq;)Ljava/lang/Object;
    • get

      Returns the value that is assigned id, or null if there is none.
      Returns:
      the value that is assigned id, or null if there is none
      Mappings:
      Namespace Name Mixin selector
      named get Lnet/minecraft/registry/Registry;get(Lnet/minecraft/util/Identifier;)Ljava/lang/Object;
      intermediary method_10223 Lnet/minecraft/class_2378;method_10223(Lnet/minecraft/class_2960;)Ljava/lang/Object;
      official a Ljz;a(Lakr;)Ljava/lang/Object;
    • getEntryInfo

      Optional<RegistryEntryInfo> getEntryInfo(RegistryKey<T> key)
      Mappings:
      Namespace Name Mixin selector
      named getEntryInfo Lnet/minecraft/registry/Registry;getEntryInfo(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
      intermediary method_57058 Lnet/minecraft/class_2378;method_57058(Lnet/minecraft/class_5321;)Ljava/util/Optional;
      official c Ljz;c(Lakq;)Ljava/util/Optional;
    • getLifecycle

      com.mojang.serialization.Lifecycle getLifecycle()
      Mappings:
      Namespace Name Mixin selector
      named getLifecycle Lnet/minecraft/registry/Registry;getLifecycle()Lcom/mojang/serialization/Lifecycle;
      intermediary method_31138 Lnet/minecraft/class_2378;method_31138()Lcom/mojang/serialization/Lifecycle;
      official e Ljz;e()Lcom/mojang/serialization/Lifecycle;
    • getOrEmpty

      default Optional<T> getOrEmpty(@Nullable @Nullable Identifier id)
      Returns the value that is assigned id, or an empty optional if there is none.
      Returns:
      the value that is assigned id, or an empty optional if there is none
      Mappings:
      Namespace Name Mixin selector
      named getOrEmpty Lnet/minecraft/registry/Registry;getOrEmpty(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
      intermediary method_17966 Lnet/minecraft/class_2378;method_17966(Lnet/minecraft/class_2960;)Ljava/util/Optional;
      official b Ljz;b(Lakr;)Ljava/util/Optional;
    • getOrEmpty

      default Optional<T> getOrEmpty(@Nullable @Nullable RegistryKey<T> key)
      Returns the value that is assigned key, or an empty optional if there is none.
      Returns:
      the value that is assigned key, or an empty optional if there is none
      Mappings:
      Namespace Name Mixin selector
      named getOrEmpty Lnet/minecraft/registry/Registry;getOrEmpty(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
      intermediary method_31189 Lnet/minecraft/class_2378;method_31189(Lnet/minecraft/class_5321;)Ljava/util/Optional;
      official e Ljz;e(Lakq;)Ljava/util/Optional;
    • getDefaultEntry

      Optional<RegistryEntry.Reference<T>> getDefaultEntry()
      Mappings:
      Namespace Name Mixin selector
      named getDefaultEntry Lnet/minecraft/registry/Registry;getDefaultEntry()Ljava/util/Optional;
      intermediary method_60385 Lnet/minecraft/class_2378;method_60385()Ljava/util/Optional;
      official a Ljz;a()Ljava/util/Optional;
    • getOrThrow

      default T getOrThrow(RegistryKey<T> key)
      Returns the value that is assigned key.
      Returns:
      the value that is assigned key
      Throws:
      IllegalStateException - if there is no value with key in the registry
      Mappings:
      Namespace Name Mixin selector
      named getOrThrow Lnet/minecraft/registry/Registry;getOrThrow(Lnet/minecraft/registry/RegistryKey;)Ljava/lang/Object;
      intermediary method_31140 Lnet/minecraft/class_2378;method_31140(Lnet/minecraft/class_5321;)Ljava/lang/Object;
      official f Ljz;f(Lakq;)Ljava/lang/Object;
    • getIds

      Set<Identifier> getIds()
      Returns the set of all IDs registered in a registry.
      Returns:
      the set of all IDs registered in a registry
      Mappings:
      Namespace Name Mixin selector
      named getIds Lnet/minecraft/registry/Registry;getIds()Ljava/util/Set;
      intermediary method_10235 Lnet/minecraft/class_2378;method_10235()Ljava/util/Set;
      official f Ljz;f()Ljava/util/Set;
    • getEntrySet

      Set<Map.Entry<RegistryKey<T>,T>> getEntrySet()
      Returns the set containing Map.Entry of the registry keys and values registered in this registry.
      Returns:
      the set containing Map.Entry of the registry keys and values registered in this registry
      Mappings:
      Namespace Name Mixin selector
      named getEntrySet Lnet/minecraft/registry/Registry;getEntrySet()Ljava/util/Set;
      intermediary method_29722 Lnet/minecraft/class_2378;method_29722()Ljava/util/Set;
      official h Ljz;h()Ljava/util/Set;
    • getKeys

      Set<RegistryKey<T>> getKeys()
      Returns the set of all registry keys registered in a registry.
      Returns:
      the set of all registry keys registered in a registry
      Mappings:
      Namespace Name Mixin selector
      named getKeys Lnet/minecraft/registry/Registry;getKeys()Ljava/util/Set;
      intermediary method_42021 Lnet/minecraft/class_2378;method_42021()Ljava/util/Set;
      official g Ljz;g()Ljava/util/Set;
    • getRandom

      Returns a random registry entry from this registry, or an empty optional if the registry is empty.
      Returns:
      a random registry entry from this registry, or an empty optional if the registry is empty
      Mappings:
      Namespace Name Mixin selector
      named getRandom Lnet/minecraft/registry/Registry;getRandom(Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;
      intermediary method_10240 Lnet/minecraft/class_2378;method_10240(Lnet/minecraft/class_5819;)Ljava/util/Optional;
      official a Ljz;a(Layw;)Ljava/util/Optional;
    • stream

      default Stream<T> stream()
      Returns a stream of all values of this registry.
      Returns:
      a stream of all values of this registry
      Mappings:
      Namespace Name Mixin selector
      named stream Lnet/minecraft/registry/Registry;stream()Ljava/util/stream/Stream;
      intermediary method_10220 Lnet/minecraft/class_2378;method_10220()Ljava/util/stream/Stream;
      official t Ljz;t()Ljava/util/stream/Stream;
    • containsId

      boolean containsId(Identifier id)
      Returns whether id is registered in this registry.
      Returns:
      whether id is registered in this registry
      Mappings:
      Namespace Name Mixin selector
      named containsId Lnet/minecraft/registry/Registry;containsId(Lnet/minecraft/util/Identifier;)Z
      intermediary method_10250 Lnet/minecraft/class_2378;method_10250(Lnet/minecraft/class_2960;)Z
      official d Ljz;d(Lakr;)Z
    • contains

      boolean contains(RegistryKey<T> key)
      Returns whether key is registered in this registry.
      Returns:
      whether key is registered in this registry
      Mappings:
      Namespace Name Mixin selector
      named contains Lnet/minecraft/registry/Registry;contains(Lnet/minecraft/registry/RegistryKey;)Z
      intermediary method_35842 Lnet/minecraft/class_2378;method_35842(Lnet/minecraft/class_5321;)Z
      official d Ljz;d(Lakq;)Z
    • register

      static <T> T register(Registry<? super T> registry, String id, T entry)
      Mappings:
      Namespace Name Mixin selector
      named register Lnet/minecraft/registry/Registry;register(Lnet/minecraft/registry/Registry;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_10226 Lnet/minecraft/class_2378;method_10226(Lnet/minecraft/class_2378;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
      official a Ljz;a(Ljz;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
    • register

      static <V, T extends V> T register(Registry<V> registry, Identifier id, T entry)
      Registers entry to registry under id.
      Returns:
      the passed entry
      Mappings:
      Namespace Name Mixin selector
      named register Lnet/minecraft/registry/Registry;register(Lnet/minecraft/registry/Registry;Lnet/minecraft/util/Identifier;Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_10230 Lnet/minecraft/class_2378;method_10230(Lnet/minecraft/class_2378;Lnet/minecraft/class_2960;Ljava/lang/Object;)Ljava/lang/Object;
      official a Ljz;a(Ljz;Lakr;Ljava/lang/Object;)Ljava/lang/Object;
    • register

      static <V, T extends V> T register(Registry<V> registry, RegistryKey<V> key, T entry)
      Registers entry to registry under key.
      Returns:
      the passed entry
      Mappings:
      Namespace Name Mixin selector
      named register Lnet/minecraft/registry/Registry;register(Lnet/minecraft/registry/Registry;Lnet/minecraft/registry/RegistryKey;Ljava/lang/Object;)Ljava/lang/Object;
      intermediary method_39197 Lnet/minecraft/class_2378;method_39197(Lnet/minecraft/class_2378;Lnet/minecraft/class_5321;Ljava/lang/Object;)Ljava/lang/Object;
      official a Ljz;a(Ljz;Lakq;Ljava/lang/Object;)Ljava/lang/Object;
    • registerReference

      static <T> RegistryEntry.Reference<T> registerReference(Registry<T> registry, RegistryKey<T> key, T entry)
      Mappings:
      Namespace Name Mixin selector
      named registerReference Lnet/minecraft/registry/Registry;registerReference(Lnet/minecraft/registry/Registry;Lnet/minecraft/registry/RegistryKey;Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;
      intermediary method_47984 Lnet/minecraft/class_2378;method_47984(Lnet/minecraft/class_2378;Lnet/minecraft/class_5321;Ljava/lang/Object;)Lnet/minecraft/class_6880$class_6883;
      official b Ljz;b(Ljz;Lakq;Ljava/lang/Object;)Ljm$c;
    • registerReference

      static <T> RegistryEntry.Reference<T> registerReference(Registry<T> registry, Identifier id, T entry)
      Mappings:
      Namespace Name Mixin selector
      named registerReference Lnet/minecraft/registry/Registry;registerReference(Lnet/minecraft/registry/Registry;Lnet/minecraft/util/Identifier;Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;
      intermediary method_47985 Lnet/minecraft/class_2378;method_47985(Lnet/minecraft/class_2378;Lnet/minecraft/class_2960;Ljava/lang/Object;)Lnet/minecraft/class_6880$class_6883;
      official b Ljz;b(Ljz;Lakr;Ljava/lang/Object;)Ljm$c;
    • freeze

      Registry<T> freeze()
      Mappings:
      Namespace Name Mixin selector
      named freeze Lnet/minecraft/registry/Registry;freeze()Lnet/minecraft/registry/Registry;
      intermediary method_40276 Lnet/minecraft/class_2378;method_40276()Lnet/minecraft/class_2378;
      official m Ljz;m()Ljz;
    • createEntry

      RegistryEntry.Reference<T> createEntry(T value)
      Mappings:
      Namespace Name Mixin selector
      named createEntry Lnet/minecraft/registry/Registry;createEntry(Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;
      intermediary method_40269 Lnet/minecraft/class_2378;method_40269(Ljava/lang/Object;)Lnet/minecraft/class_6880$class_6883;
      official f Ljz;f(Ljava/lang/Object;)Ljm$c;
    • getEntry

      Optional<RegistryEntry.Reference<T>> getEntry(int rawId)
      Returns the reference registry entry for the value assigned rawId, or an empty optional if there is no such value.
      Returns:
      the reference registry entry for the value assigned rawId, or an empty optional if there is no such value
      Mappings:
      Namespace Name Mixin selector
      named getEntry Lnet/minecraft/registry/Registry;getEntry(I)Ljava/util/Optional;
      intermediary method_40265 Lnet/minecraft/class_2378;method_40265(I)Ljava/util/Optional;
      official c Ljz;c(I)Ljava/util/Optional;
    • getEntry

      Mappings:
      Namespace Name Mixin selector
      named getEntry Lnet/minecraft/registry/Registry;getEntry(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
      intermediary method_55841 Lnet/minecraft/class_2378;method_55841(Lnet/minecraft/class_2960;)Ljava/util/Optional;
      official c Ljz;c(Lakr;)Ljava/util/Optional;
    • getEntry

      Returns the reference registry entry for the value assigned key, or an empty optional if there is no such value.
      Returns:
      the reference registry entry for the value assigned key, or an empty optional if there is no such value
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named getEntry Lnet/minecraft/registry/Registry;getEntry(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;
      intermediary method_40264 Lnet/minecraft/class_2378;method_40264(Lnet/minecraft/class_5321;)Ljava/util/Optional;
      official b Ljz;b(Lakq;)Ljava/util/Optional;
    • getEntry

      RegistryEntry<T> getEntry(T value)
      Mappings:
      Namespace Name Mixin selector
      named getEntry Lnet/minecraft/registry/Registry;getEntry(Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry;
      intermediary method_47983 Lnet/minecraft/class_2378;method_47983(Ljava/lang/Object;)Lnet/minecraft/class_6880;
      official e Ljz;e(Ljava/lang/Object;)Ljm;
    • entryOf

      default RegistryEntry.Reference<T> entryOf(RegistryKey<T> key)
      Returns the reference registry entry for the value assigned key.
      Returns:
      the reference registry entry for the value assigned key
      Throws:
      IllegalStateException - if there is no value that is assigned key
      See Also:
      Mappings:
      Namespace Name Mixin selector
      named entryOf Lnet/minecraft/registry/Registry;entryOf(Lnet/minecraft/registry/RegistryKey;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;
      intermediary method_40290 Lnet/minecraft/class_2378;method_40290(Lnet/minecraft/class_5321;)Lnet/minecraft/class_6880$class_6883;
      official g Ljz;g(Lakq;)Ljm$c;
    • streamEntries

      Stream<RegistryEntry.Reference<T>> streamEntries()
      Returns a stream of reference registry entries of this registry.
      Returns:
      a stream of reference registry entries of this registry
      Mappings:
      Namespace Name Mixin selector
      named streamEntries Lnet/minecraft/registry/Registry;streamEntries()Ljava/util/stream/Stream;
      intermediary method_40270 Lnet/minecraft/class_2378;method_40270()Ljava/util/stream/Stream;
      official i Ljz;i()Ljava/util/stream/Stream;
    • getEntryList

      Optional<RegistryEntryList.Named<T>> getEntryList(TagKey<T> tag)
      Returns the registry entry list of values that are assigned tag, or an empty optional if the tag is not known to the registry.
      Returns:
      the registry entry list of values that are assigned tag, or an empty optional if the tag is not known to the registry
      Mappings:
      Namespace Name Mixin selector
      named getEntryList Lnet/minecraft/registry/Registry;getEntryList(Lnet/minecraft/registry/tag/TagKey;)Ljava/util/Optional;
      intermediary method_40266 Lnet/minecraft/class_2378;method_40266(Lnet/minecraft/class_6862;)Ljava/util/Optional;
      official b Ljz;b(Lawu;)Ljava/util/Optional;
    • iterateEntries

      default Iterable<RegistryEntry<T>> iterateEntries(TagKey<T> tag)
      Returns an iterable of values that are assigned tag, or an empty iterable if the tag is not known to the registry.
      Returns:
      an iterable of values that are assigned tag, or an empty iterable if the tag is not known to the registry
      Mappings:
      Namespace Name Mixin selector
      named iterateEntries Lnet/minecraft/registry/Registry;iterateEntries(Lnet/minecraft/registry/tag/TagKey;)Ljava/lang/Iterable;
      intermediary method_40286 Lnet/minecraft/class_2378;method_40286(Lnet/minecraft/class_6862;)Ljava/lang/Iterable;
      official c Ljz;c(Lawu;)Ljava/lang/Iterable;
    • getRandomEntry

      default Optional<RegistryEntry<T>> getRandomEntry(TagKey<T> tag, Random random)
      Returns a random entry from tag, or an empty Optional if the tag is empty.
      Returns:
      a random entry from tag, or an empty Optional if the tag is empty
      Mappings:
      Namespace Name Mixin selector
      named getRandomEntry Lnet/minecraft/registry/Registry;getRandomEntry(Lnet/minecraft/registry/tag/TagKey;Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;
      intermediary method_56159 Lnet/minecraft/class_2378;method_56159(Lnet/minecraft/class_6862;Lnet/minecraft/class_5819;)Ljava/util/Optional;
      official a Ljz;a(Lawu;Layw;)Ljava/util/Optional;
    • getOrCreateEntryList

      RegistryEntryList.Named<T> getOrCreateEntryList(TagKey<T> tag)
      Mappings:
      Namespace Name Mixin selector
      named getOrCreateEntryList Lnet/minecraft/registry/Registry;getOrCreateEntryList(Lnet/minecraft/registry/tag/TagKey;)Lnet/minecraft/registry/entry/RegistryEntryList$Named;
      intermediary method_40260 Lnet/minecraft/class_2378;method_40260(Lnet/minecraft/class_6862;)Lnet/minecraft/class_6885$class_6888;
      official a Ljz;a(Lawu;)Ljq$c;
    • streamTagsAndEntries

      Stream<com.mojang.datafixers.util.Pair<TagKey<T>,RegistryEntryList.Named<T>>> streamTagsAndEntries()
      Mappings:
      Namespace Name Mixin selector
      named streamTagsAndEntries Lnet/minecraft/registry/Registry;streamTagsAndEntries()Ljava/util/stream/Stream;
      intermediary method_40272 Lnet/minecraft/class_2378;method_40272()Ljava/util/stream/Stream;
      official j Ljz;j()Ljava/util/stream/Stream;
    • streamTags

      Stream<TagKey<T>> streamTags()
      Returns a stream of all tag keys known to this registry.
      Returns:
      a stream of all tag keys known to this registry
      Mappings:
      Namespace Name Mixin selector
      named streamTags Lnet/minecraft/registry/Registry;streamTags()Ljava/util/stream/Stream;
      intermediary method_40273 Lnet/minecraft/class_2378;method_40273()Ljava/util/stream/Stream;
      official k Ljz;k()Ljava/util/stream/Stream;
    • clearTags

      void clearTags()
      Mappings:
      Namespace Name Mixin selector
      named clearTags Lnet/minecraft/registry/Registry;clearTags()V
      intermediary method_40278 Lnet/minecraft/class_2378;method_40278()V
      official n Ljz;n()V
    • populateTags

      void populateTags(Map<TagKey<T>,List<RegistryEntry<T>>> tagEntries)
      Mappings:
      Namespace Name Mixin selector
      named populateTags Lnet/minecraft/registry/Registry;populateTags(Ljava/util/Map;)V
      intermediary method_40257 Lnet/minecraft/class_2378;method_40257(Ljava/util/Map;)V
      official a Ljz;a(Ljava/util/Map;)V
    • getIndexedEntries

      default IndexedIterable<RegistryEntry<T>> getIndexedEntries()
      Mappings:
      Namespace Name Mixin selector
      named getIndexedEntries Lnet/minecraft/registry/Registry;getIndexedEntries()Lnet/minecraft/util/collection/IndexedIterable;
      intermediary method_40295 Lnet/minecraft/class_2378;method_40295()Lnet/minecraft/class_2359;
      official u Ljz;u()Ljr;
    • getEntryOwner

      RegistryEntryOwner<T> getEntryOwner()
      Mappings:
      Namespace Name Mixin selector
      named getEntryOwner Lnet/minecraft/registry/Registry;getEntryOwner()Lnet/minecraft/registry/entry/RegistryEntryOwner;
      intermediary method_46770 Lnet/minecraft/class_2378;method_46770()Lnet/minecraft/class_7876;
      official p Ljz;p()Ljp;
    • getReadOnlyWrapper

      RegistryWrapper.Impl<T> getReadOnlyWrapper()
      Returns a registry wrapper that does not mutate the backing registry under any circumstances.
      Returns:
      a registry wrapper that does not mutate the backing registry under any circumstances
      Mappings:
      Namespace Name Mixin selector
      named getReadOnlyWrapper Lnet/minecraft/registry/Registry;getReadOnlyWrapper()Lnet/minecraft/registry/RegistryWrapper$Impl;
      intermediary method_46771 Lnet/minecraft/class_2378;method_46771()Lnet/minecraft/class_7225$class_7226;
      official q Ljz;q()Ljo$b;
    • getTagCreatingWrapper

      default RegistryWrapper.Impl<T> getTagCreatingWrapper()
      Returns a registry wrapper that creates and stores a new registry entry list when handling an unknown tag key.
      Returns:
      a registry wrapper that creates and stores a new registry entry list when handling an unknown tag key
      Mappings:
      Namespace Name Mixin selector
      named getTagCreatingWrapper Lnet/minecraft/registry/Registry;getTagCreatingWrapper()Lnet/minecraft/registry/RegistryWrapper$Impl;
      intermediary method_46772 Lnet/minecraft/class_2378;method_46772()Lnet/minecraft/class_7225$class_7226;
      official v Ljz;v()Ljo$b;