Interface Registry<T>
- All Superinterfaces:
IndexedIterable<T>,Iterable<T>,com.mojang.serialization.Keyable,RegistryEntryLookup<T>,RegistryEntryOwner<T>,RegistryWrapper<T>,RegistryWrapper.Impl<T>
- All Known Subinterfaces:
DefaultedRegistry<T>,MutableRegistry<T>
- All Known Implementing Classes:
SimpleDefaultedRegistry,SimpleRegistry
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.getOrThrow(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:
RegistryEntryLookup.getOrThrow(RegistryKey)orRegistryEntryLookup.getOptional(RegistryKey)for getting the registry entry from the key.getOptionalValue(Identifier)orgetOptionalValue(RegistryKey)for getting the registered value from the ID or the registry key.getId(Object)for getting the ID of a registered value.getEntry(int)for getting the registry entry from the raw ID.RegistryEntryLookup.getOptional(TagKey)anditerateEntries(net.minecraft.registry.tag.TagKey<T>)for getting the contents of a tag,streamTags()for streaming all tags of a 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, andRegistries.GAME_EVENTregistries. - 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/Registryintermediary net/minecraft/class_2378official jt
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface net.minecraft.registry.RegistryEntryLookup
RegistryEntryLookup.RegistryLookupNested classes/interfaces inherited from interface net.minecraft.registry.RegistryWrapper
RegistryWrapper.Impl<T>, RegistryWrapper.WrapperLookupNested classes/interfaces inherited from interface net.minecraft.registry.RegistryWrapper.Impl
RegistryWrapper.Impl.Delegating<T> -
Field Summary
Fields inherited from interface net.minecraft.util.collection.IndexedIterable
ABSENT_RAW_ID -
Method Summary
Modifier and TypeMethodDescriptionbooleancontains(RegistryKey<T> key) Returns whetherkeyis registered in this registry.booleancontainsId(Identifier id) Returns whetheridis registered in this registry.createEntry(T value) freeze()get(@Nullable RegistryKey<T> key) Returns the value that is assignedkey, ornullif there is none.get(@Nullable Identifier id) Returns the value that is assignedid, ornullif there is none.default com.mojang.serialization.Codec<T> getCodec()Returns the codec for serializingT.getEntry(int rawId) Returns the reference registry entry for the value assignedrawId, or an empty optional if there is no such value.getEntry(Identifier id) Returns the reference registry entry for the value that is assignedid, or an empty optional if there is no such value.default com.mojang.serialization.Codec<RegistryEntry<T>> Returns the codec for serializing the registry entry ofT.getEntryInfo(RegistryKey<T> key) Set<Map.Entry<RegistryKey<T>, T>> Returns the set containingMap.Entryof the registry keys and values registered in this registry.Returns the ID assigned tovalue, ornullif it is not registered.getIds()Returns the set of all IDs registered in a registry.default IndexedIterable<RegistryEntry<T>> RegistryKey<? extends Registry<T>> getKey()Returns the registry key ofvalue, or an empty optional if it is not registered.Set<RegistryKey<T>> getKeys()Returns the set of all registry keys registered in a registry.Returns the value that is assignedkey, or an empty optional if there is none.Returns the value that is assignedid, or an empty optional if there is none.Returns a random registry entry from this registry, or an empty optional if the registry is empty.default Optional<RegistryEntry<T>> getRandomEntry(TagKey<T> tag, Random random) Returns a random entry fromtag, or an emptyOptionalif the tag is empty.intprivate com.mojang.serialization.Codec<RegistryEntry.Reference<T>> default TgetValueOrThrow(RegistryKey<T> key) Returns the value that is assignedkey.default Iterable<RegistryEntry<T>> iterateEntries(TagKey<T> tag) Returns an iterable of values that are assignedtag, or an empty iterable if the tag is not known to the registry.default <U> Stream<U> keys(com.mojang.serialization.DynamicOps<U> ops) static <T> Tstatic <V,T extends V>
Tregister(Registry<V> registry, RegistryKey<V> key, T entry) Registersentrytoregistryunderkey.static <V,T extends V>
Tregister(Registry<V> registry, Identifier id, T entry) Registersentrytoregistryunderid.static <T> RegistryEntry.Reference<T> registerReference(Registry<T> registry, RegistryKey<T> key, T entry) static <T> RegistryEntry.Reference<T> registerReference(Registry<T> registry, Identifier id, T entry) stream()Returns a stream of all values of this registry.private com.mojang.serialization.DataResult<RegistryEntry.Reference<T>> validateReference(RegistryEntry<T> entry) Methods inherited from interface net.minecraft.util.collection.IndexedIterable
get, getOrThrow, getRawIdOrThrow, sizeMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface net.minecraft.registry.RegistryEntryLookup
getOptional, getOptional, getOrThrow, getOrThrowMethods inherited from interface net.minecraft.registry.entry.RegistryEntryOwner
ownerEqualsMethods inherited from interface net.minecraft.registry.RegistryWrapper
getTags, streamEntries, streamKeys, streamTagKeysMethods inherited from interface net.minecraft.registry.RegistryWrapper.Impl
getLifecycle, withFeatureFilter, withPredicateFilter
-
Method Details
-
getKey
RegistryKey<? extends Registry<T>> getKey()- Specified by:
getKeyin interfaceRegistryWrapper.Impl<T>- Mappings:
Namespace Name Mixin selector named getKeyLnet/minecraft/registry/RegistryWrapper$Impl;getKey()Lnet/minecraft/registry/RegistryKey;intermediary method_46765Lnet/minecraft/class_7225$class_7226;method_46765()Lnet/minecraft/class_5321;official gLji$b;g()Lalq;
-
getCodec
Returns the codec for serializingT.- 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 getCodecLnet/minecraft/registry/Registry;getCodec()Lcom/mojang/serialization/Codec;intermediary method_39673Lnet/minecraft/class_2378;method_39673()Lcom/mojang/serialization/Codec;official qLjt;q()Lcom/mojang/serialization/Codec;
-
getEntryCodec
Returns the codec for serializing the registry entry ofT.- 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 getEntryCodecLnet/minecraft/registry/Registry;getEntryCodec()Lcom/mojang/serialization/Codec;intermediary method_40294Lnet/minecraft/class_2378;method_40294()Lcom/mojang/serialization/Codec;official rLjt;r()Lcom/mojang/serialization/Codec;
-
getReferenceEntryCodec
- Mappings:
Namespace Name Mixin selector named getReferenceEntryCodecLnet/minecraft/registry/Registry;getReferenceEntryCodec()Lcom/mojang/serialization/Codec;intermediary method_57059Lnet/minecraft/class_2378;method_57059()Lcom/mojang/serialization/Codec;official bLjt;b()Lcom/mojang/serialization/Codec;
-
validateReference
private com.mojang.serialization.DataResult<RegistryEntry.Reference<T>> validateReference(RegistryEntry<T> entry) - Mappings:
Namespace Name Mixin selector named validateReferenceLnet/minecraft/registry/Registry;validateReference(Lnet/minecraft/registry/entry/RegistryEntry;)Lcom/mojang/serialization/DataResult;intermediary method_57061Lnet/minecraft/class_2378;method_57061(Lnet/minecraft/class_6880;)Lcom/mojang/serialization/DataResult;official aLjt;a(Ljg;)Lcom/mojang/serialization/DataResult;
-
keys
- Specified by:
keysin interfacecom.mojang.serialization.Keyable- Mappings:
Namespace Name Mixin selector named keysLnet/minecraft/registry/Registry;keys(Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;intermediary keysLnet/minecraft/class_2378;keys(Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;official keysLjt;keys(Lcom/mojang/serialization/DynamicOps;)Ljava/util/stream/Stream;
-
getId
Returns the ID assigned tovalue, ornullif it is not registered.- Returns:
- the ID assigned to
value, ornullif it is not registered - Mappings:
Namespace Name Mixin selector named getIdLnet/minecraft/registry/Registry;getId(Ljava/lang/Object;)Lnet/minecraft/util/Identifier;intermediary method_10221Lnet/minecraft/class_2378;method_10221(Ljava/lang/Object;)Lnet/minecraft/class_2960;official bLjt;b(Ljava/lang/Object;)Lalr;
-
getKey
Returns the registry key ofvalue, 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 getKeyLnet/minecraft/registry/Registry;getKey(Ljava/lang/Object;)Ljava/util/Optional;intermediary method_29113Lnet/minecraft/class_2378;method_29113(Ljava/lang/Object;)Ljava/util/Optional;official dLjt;d(Ljava/lang/Object;)Ljava/util/Optional;
-
getRawId
- Specified by:
getRawIdin interfaceIndexedIterable<T>- Mappings:
Namespace Name Mixin selector named getRawIdLnet/minecraft/util/collection/IndexedIterable;getRawId(Ljava/lang/Object;)Iintermediary method_10206Lnet/minecraft/class_2359;method_10206(Ljava/lang/Object;)Iofficial aLjl;a(Ljava/lang/Object;)I
-
get
Returns the value that is assignedkey, ornullif there is none.- Returns:
- the value that is assigned
key, ornullif there is none - Mappings:
Namespace Name Mixin selector named getLnet/minecraft/registry/Registry;get(Lnet/minecraft/registry/RegistryKey;)Ljava/lang/Object;intermediary method_29107Lnet/minecraft/class_2378;method_29107(Lnet/minecraft/class_5321;)Ljava/lang/Object;official cLjt;c(Lalq;)Ljava/lang/Object;
-
get
Returns the value that is assignedid, ornullif there is none.- Returns:
- the value that is assigned
id, ornullif there is none - Mappings:
Namespace Name Mixin selector named getLnet/minecraft/registry/Registry;get(Lnet/minecraft/util/Identifier;)Ljava/lang/Object;intermediary method_63535Lnet/minecraft/class_2378;method_63535(Lnet/minecraft/class_2960;)Ljava/lang/Object;official aLjt;a(Lalr;)Ljava/lang/Object;
-
getEntryInfo
- Mappings:
Namespace Name Mixin selector named getEntryInfoLnet/minecraft/registry/Registry;getEntryInfo(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;intermediary method_57058Lnet/minecraft/class_2378;method_57058(Lnet/minecraft/class_5321;)Ljava/util/Optional;official dLjt;d(Lalq;)Ljava/util/Optional;
-
getOptionalValue
Returns the value that is assignedid, 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 getOptionalValueLnet/minecraft/registry/Registry;getOptionalValue(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;intermediary method_17966Lnet/minecraft/class_2378;method_17966(Lnet/minecraft/class_2960;)Ljava/util/Optional;official bLjt;b(Lalr;)Ljava/util/Optional;
-
getOptionalValue
Returns the value that is assignedkey, 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 getOptionalValueLnet/minecraft/registry/Registry;getOptionalValue(Lnet/minecraft/registry/RegistryKey;)Ljava/util/Optional;intermediary method_31189Lnet/minecraft/class_2378;method_31189(Lnet/minecraft/class_5321;)Ljava/util/Optional;official fLjt;f(Lalq;)Ljava/util/Optional;
-
getDefaultEntry
Optional<RegistryEntry.Reference<T>> getDefaultEntry()- Mappings:
Namespace Name Mixin selector named getDefaultEntryLnet/minecraft/registry/Registry;getDefaultEntry()Ljava/util/Optional;intermediary method_60385Lnet/minecraft/class_2378;method_60385()Ljava/util/Optional;official aLjt;a()Ljava/util/Optional;
-
getValueOrThrow
Returns the value that is assignedkey.- Returns:
- the value that is assigned
key - Throws:
IllegalStateException- if there is no value withkeyin the registry- Mappings:
Namespace Name Mixin selector named getValueOrThrowLnet/minecraft/registry/Registry;getValueOrThrow(Lnet/minecraft/registry/RegistryKey;)Ljava/lang/Object;intermediary method_31140Lnet/minecraft/class_2378;method_31140(Lnet/minecraft/class_5321;)Ljava/lang/Object;official gLjt;g(Lalq;)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 getIdsLnet/minecraft/registry/Registry;getIds()Ljava/util/Set;intermediary method_10235Lnet/minecraft/class_2378;method_10235()Ljava/util/Set;official iLjt;i()Ljava/util/Set;
-
getEntrySet
Set<Map.Entry<RegistryKey<T>,T>> getEntrySet()Returns the set containingMap.Entryof the registry keys and values registered in this registry.- Returns:
- the set containing
Map.Entryof the registry keys and values registered in this registry - Mappings:
Namespace Name Mixin selector named getEntrySetLnet/minecraft/registry/Registry;getEntrySet()Ljava/util/Set;intermediary method_29722Lnet/minecraft/class_2378;method_29722()Ljava/util/Set;official kLjt;k()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 getKeysLnet/minecraft/registry/Registry;getKeys()Ljava/util/Set;intermediary method_42021Lnet/minecraft/class_2378;method_42021()Ljava/util/Set;official jLjt;j()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 getRandomLnet/minecraft/registry/Registry;getRandom(Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;intermediary method_10240Lnet/minecraft/class_2378;method_10240(Lnet/minecraft/class_5819;)Ljava/util/Optional;official aLjt;a(Lbai;)Ljava/util/Optional;
-
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 streamLnet/minecraft/registry/Registry;stream()Ljava/util/stream/Stream;intermediary method_10220Lnet/minecraft/class_2378;method_10220()Ljava/util/stream/Stream;official sLjt;s()Ljava/util/stream/Stream;
-
containsId
Returns whetheridis registered in this registry.- Returns:
- whether
idis registered in this registry - Mappings:
Namespace Name Mixin selector named containsIdLnet/minecraft/registry/Registry;containsId(Lnet/minecraft/util/Identifier;)Zintermediary method_10250Lnet/minecraft/class_2378;method_10250(Lnet/minecraft/class_2960;)Zofficial dLjt;d(Lalr;)Z
-
contains
Returns whetherkeyis registered in this registry.- Returns:
- whether
keyis registered in this registry - Mappings:
Namespace Name Mixin selector named containsLnet/minecraft/registry/Registry;contains(Lnet/minecraft/registry/RegistryKey;)Zintermediary method_35842Lnet/minecraft/class_2378;method_35842(Lnet/minecraft/class_5321;)Zofficial eLjt;e(Lalq;)Z
-
register
- Mappings:
Namespace Name Mixin selector named registerLnet/minecraft/registry/Registry;register(Lnet/minecraft/registry/Registry;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;intermediary method_10226Lnet/minecraft/class_2378;method_10226(Lnet/minecraft/class_2378;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;official aLjt;a(Ljt;Ljava/lang/String;Ljava/lang/Object;)Ljava/lang/Object;
-
register
Registersentrytoregistryunderid.- Returns:
- the passed
entry - Mappings:
Namespace Name Mixin selector named registerLnet/minecraft/registry/Registry;register(Lnet/minecraft/registry/Registry;Lnet/minecraft/util/Identifier;Ljava/lang/Object;)Ljava/lang/Object;intermediary method_10230Lnet/minecraft/class_2378;method_10230(Lnet/minecraft/class_2378;Lnet/minecraft/class_2960;Ljava/lang/Object;)Ljava/lang/Object;official aLjt;a(Ljt;Lalr;Ljava/lang/Object;)Ljava/lang/Object;
-
register
Registersentrytoregistryunderkey.- Returns:
- the passed
entry - Mappings:
Namespace Name Mixin selector named registerLnet/minecraft/registry/Registry;register(Lnet/minecraft/registry/Registry;Lnet/minecraft/registry/RegistryKey;Ljava/lang/Object;)Ljava/lang/Object;intermediary method_39197Lnet/minecraft/class_2378;method_39197(Lnet/minecraft/class_2378;Lnet/minecraft/class_5321;Ljava/lang/Object;)Ljava/lang/Object;official aLjt;a(Ljt;Lalq;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 registerReferenceLnet/minecraft/registry/Registry;registerReference(Lnet/minecraft/registry/Registry;Lnet/minecraft/registry/RegistryKey;Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary method_47984Lnet/minecraft/class_2378;method_47984(Lnet/minecraft/class_2378;Lnet/minecraft/class_5321;Ljava/lang/Object;)Lnet/minecraft/class_6880$class_6883;official bLjt;b(Ljt;Lalq;Ljava/lang/Object;)Ljg$c;
-
registerReference
static <T> RegistryEntry.Reference<T> registerReference(Registry<T> registry, Identifier id, T entry) - Mappings:
Namespace Name Mixin selector named registerReferenceLnet/minecraft/registry/Registry;registerReference(Lnet/minecraft/registry/Registry;Lnet/minecraft/util/Identifier;Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary method_47985Lnet/minecraft/class_2378;method_47985(Lnet/minecraft/class_2378;Lnet/minecraft/class_2960;Ljava/lang/Object;)Lnet/minecraft/class_6880$class_6883;official bLjt;b(Ljt;Lalr;Ljava/lang/Object;)Ljg$c;
-
freeze
- Mappings:
Namespace Name Mixin selector named freezeLnet/minecraft/registry/Registry;freeze()Lnet/minecraft/registry/Registry;intermediary method_40276Lnet/minecraft/class_2378;method_40276()Lnet/minecraft/class_2378;official nLjt;n()Ljt;
-
createEntry
- Mappings:
Namespace Name Mixin selector named createEntryLnet/minecraft/registry/Registry;createEntry(Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary method_40269Lnet/minecraft/class_2378;method_40269(Ljava/lang/Object;)Lnet/minecraft/class_6880$class_6883;official fLjt;f(Ljava/lang/Object;)Ljg$c;
-
getEntry
Returns the reference registry entry for the value assignedrawId, 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 getEntryLnet/minecraft/registry/Registry;getEntry(I)Ljava/util/Optional;intermediary method_40265Lnet/minecraft/class_2378;method_40265(I)Ljava/util/Optional;official cLjt;c(I)Ljava/util/Optional;
-
getEntry
Returns the reference registry entry for the value that is assignedid, or an empty optional if there is no such value.- Returns:
- the reference registry entry for the value that is assigned
id, or an empty optional if there is no such value - Mappings:
Namespace Name Mixin selector named getEntryLnet/minecraft/registry/Registry;getEntry(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;intermediary method_10223Lnet/minecraft/class_2378;method_10223(Lnet/minecraft/class_2960;)Ljava/util/Optional;official cLjt;c(Lalr;)Ljava/util/Optional;
-
getEntry
- Mappings:
Namespace Name Mixin selector named getEntryLnet/minecraft/registry/Registry;getEntry(Ljava/lang/Object;)Lnet/minecraft/registry/entry/RegistryEntry;intermediary method_47983Lnet/minecraft/class_2378;method_47983(Ljava/lang/Object;)Lnet/minecraft/class_6880;official eLjt;e(Ljava/lang/Object;)Ljg;
-
iterateEntries
Returns an iterable of values that are assignedtag, 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 iterateEntriesLnet/minecraft/registry/Registry;iterateEntries(Lnet/minecraft/registry/tag/TagKey;)Ljava/lang/Iterable;intermediary method_40286Lnet/minecraft/class_2378;method_40286(Lnet/minecraft/class_6862;)Ljava/lang/Iterable;official cLjt;c(Layc;)Ljava/lang/Iterable;
-
getRandomEntry
Returns a random entry fromtag, or an emptyOptionalif the tag is empty.- Returns:
- a random entry from
tag, or an emptyOptionalif the tag is empty - Mappings:
Namespace Name Mixin selector named getRandomEntryLnet/minecraft/registry/Registry;getRandomEntry(Lnet/minecraft/registry/tag/TagKey;Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;intermediary method_56159Lnet/minecraft/class_2378;method_56159(Lnet/minecraft/class_6862;Lnet/minecraft/class_5819;)Ljava/util/Optional;official aLjt;a(Layc;Lbai;)Ljava/util/Optional;
-
streamTags
Stream<RegistryEntryList.Named<T>> streamTags()- Mappings:
Namespace Name Mixin selector named streamTagsLnet/minecraft/registry/Registry;streamTags()Ljava/util/stream/Stream;intermediary method_40272Lnet/minecraft/class_2378;method_40272()Ljava/util/stream/Stream;official lLjt;l()Ljava/util/stream/Stream;
-
getIndexedEntries
- Mappings:
Namespace Name Mixin selector named getIndexedEntriesLnet/minecraft/registry/Registry;getIndexedEntries()Lnet/minecraft/util/collection/IndexedIterable;intermediary method_40295Lnet/minecraft/class_2378;method_40295()Lnet/minecraft/class_2359;official tLjt;t()Ljl;
-
startTagReload
- Mappings:
Namespace Name Mixin selector named startTagReloadLnet/minecraft/registry/Registry;startTagReload(Lnet/minecraft/registry/tag/TagGroupLoader$RegistryTags;)Lnet/minecraft/registry/Registry$PendingTagLoad;intermediary method_62683Lnet/minecraft/class_2378;method_62683(Lnet/minecraft/class_3503$class_6863;)Lnet/minecraft/class_2378$class_10106;official aLjt;a(Layd$c;)Ljt$a;
-