Package net.minecraft.registry
Class SimpleDefaultedRegistry<T>
java.lang.Object
net.minecraft.registry.SimpleRegistry<T>
net.minecraft.registry.SimpleDefaultedRegistry<T>
- All Implemented Interfaces:
com.mojang.serialization.Keyable
,Iterable<T>
,DefaultedRegistry<T>
,MutableRegistry<T>
,Registry<T>
,IndexedIterable<T>
An implementation of
Registry
with a default ID and value for unknown lookups.- Mappings:
Namespace Name named net/minecraft/registry/SimpleDefaultedRegistry
intermediary net/minecraft/class_2348
official jc
-
Field Summary
Fields inherited from class net.minecraft.registry.SimpleRegistry
key
Fields inherited from interface net.minecraft.util.collection.IndexedIterable
ABSENT_RAW_ID
-
Constructor Summary
ConstructorDescriptionSimpleDefaultedRegistry
(String defaultId, RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusive) -
Method Summary
Modifier and TypeMethodDescriptionadd
(RegistryKey<T> key, T value, RegistryEntryInfo info) get
(int index) get
(@Nullable Identifier id) Returns the value that is assignedid
, ornull
if there is none.Returns the ID assigned tovalue
, ornull
if it is not registered.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.int
Methods inherited from class net.minecraft.registry.SimpleRegistry
clearTags, contains, containsId, createEntry, createMutableEntryLookup, freeze, get, getEntry, getEntry, getEntry, getEntry, getEntryInfo, getEntryList, getEntryOwner, getEntrySet, getIds, getKey, getKey, getKeys, getLifecycle, getOrCreateEntry, getOrCreateEntryList, getReadOnlyWrapper, isEmpty, iterator, populateTags, size, streamEntries, streamTags, streamTagsAndEntries, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.util.collection.IndexedIterable
getOrThrow, getRawIdOrThrow, size
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface net.minecraft.registry.Registry
clearTags, contains, containsId, createEntry, entryOf, freeze, get, getCodec, getEntry, getEntry, getEntry, getEntry, getEntryCodec, getEntryInfo, getEntryList, getEntryOwner, getEntrySet, getIds, getIndexedEntries, getKey, getKey, getKeys, getLifecycle, getOrCreateEntryList, getOrEmpty, getOrThrow, getRandomEntry, getReadOnlyWrapper, getTagCreatingWrapper, iterateEntries, keys, populateTags, stream, streamEntries, streamTags, streamTagsAndEntries
-
Field Details
-
defaultId
- Mappings:
Namespace Name Mixin selector named defaultId
Lnet/minecraft/registry/SimpleDefaultedRegistry;defaultId:Lnet/minecraft/util/Identifier;
intermediary field_11014
Lnet/minecraft/class_2348;field_11014:Lnet/minecraft/class_2960;
official b
Ljc;b:Lalf;
-
defaultEntry
- Mappings:
Namespace Name Mixin selector named defaultEntry
Lnet/minecraft/registry/SimpleDefaultedRegistry;defaultEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;
intermediary field_11015
Lnet/minecraft/class_2348;field_11015:Lnet/minecraft/class_6880$class_6883;
official c
Ljc;c:Lji$c;
-
-
Constructor Details
-
SimpleDefaultedRegistry
public SimpleDefaultedRegistry(String defaultId, RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusive) - Mappings:
Namespace Name Mixin selector named <init>
Lnet/minecraft/registry/SimpleDefaultedRegistry;<init>(Ljava/lang/String;Lnet/minecraft/registry/RegistryKey;Lcom/mojang/serialization/Lifecycle;Z)V
intermediary <init>
Lnet/minecraft/class_2348;<init>(Ljava/lang/String;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Z)V
official <init>
Ljc;<init>(Ljava/lang/String;Lale;Lcom/mojang/serialization/Lifecycle;Z)V
-
-
Method Details
-
add
- Specified by:
add
in interfaceMutableRegistry<T>
- Overrides:
add
in classSimpleRegistry<T>
- Mappings:
Namespace Name Mixin selector named add
Lnet/minecraft/registry/MutableRegistry;add(Lnet/minecraft/registry/RegistryKey;Ljava/lang/Object;Lnet/minecraft/registry/entry/RegistryEntryInfo;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;
intermediary method_10272
Lnet/minecraft/class_2385;method_10272(Lnet/minecraft/class_5321;Ljava/lang/Object;Lnet/minecraft/class_9248;)Lnet/minecraft/class_6880$class_6883;
official a
Lke;a(Lale;Ljava/lang/Object;Lju;)Lji$c;
-
getRawId
- Specified by:
getRawId
in interfaceIndexedIterable<T>
- Specified by:
getRawId
in interfaceRegistry<T>
- Overrides:
getRawId
in classSimpleRegistry<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
Ljn;a(Ljava/lang/Object;)I
-
getId
Returns the ID assigned tovalue
, ornull
if it is not registered.- Specified by:
getId
in interfaceDefaultedRegistry<T>
- Specified by:
getId
in interfaceRegistry<T>
- Overrides:
getId
in classSimpleRegistry<T>
- Returns:
- the ID assigned to
value
, ornull
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
Ljv;b(Ljava/lang/Object;)Lalf;
-
get
Returns the value that is assignedid
, ornull
if there is none.- Specified by:
get
in interfaceDefaultedRegistry<T>
- Specified by:
get
in interfaceRegistry<T>
- Overrides:
get
in classSimpleRegistry<T>
- Returns:
- the value that is assigned
id
, ornull
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
Ljv;a(Lalf;)Ljava/lang/Object;
-
getOrEmpty
Returns the value that is assignedid
, or an empty optional if there is none.- Specified by:
getOrEmpty
in interfaceRegistry<T>
- 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
Ljv;b(Lalf;)Ljava/util/Optional;
-
get
- Specified by:
get
in interfaceDefaultedRegistry<T>
- Specified by:
get
in interfaceIndexedIterable<T>
- Overrides:
get
in classSimpleRegistry<T>
- Mappings:
Namespace Name Mixin selector named get
Lnet/minecraft/util/collection/IndexedIterable;get(I)Ljava/lang/Object;
intermediary method_10200
Lnet/minecraft/class_2359;method_10200(I)Ljava/lang/Object;
official a
Ljn;a(I)Ljava/lang/Object;
-
getRandom
Returns a random registry entry from this registry, or an empty optional if the registry is empty.- Specified by:
getRandom
in interfaceRegistry<T>
- Overrides:
getRandom
in classSimpleRegistry<T>
- 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
Ljv;a(Lazh;)Ljava/util/Optional;
-
getDefaultId
- Specified by:
getDefaultId
in interfaceDefaultedRegistry<T>
- Mappings:
Namespace Name Mixin selector named getDefaultId
Lnet/minecraft/registry/DefaultedRegistry;getDefaultId()Lnet/minecraft/util/Identifier;
intermediary method_10137
Lnet/minecraft/class_7922;method_10137()Lnet/minecraft/class_2960;
official a
Ljd;a()Lalf;
-