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>,RegistryEntryOwner<T>,MutableRegistry<T>,Registry<T>,RegistryEntryLookup<T>,RegistryWrapper<T>,RegistryWrapper.Impl<T>,IndexedIterable<T>
An implementation of
Registry with a default ID and value for unknown lookups.- Mappings:
Namespace Name named net/minecraft/registry/SimpleDefaultedRegistryintermediary net/minecraft/class_2348official jl
-
Nested Class Summary
Nested classes/interfaces inherited from interface net.minecraft.registry.Registry
Registry.PendingTagLoad<T>Nested 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
FieldsFields inherited from class net.minecraft.registry.SimpleRegistry
tagLookupFields inherited from interface net.minecraft.util.collection.IndexedIterable
ABSENT_RAW_ID -
Constructor Summary
ConstructorsConstructorDescriptionSimpleDefaultedRegistry(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, ornullif there is none.Returns the ID assigned tovalue, ornullif 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.intMethods inherited from class net.minecraft.registry.SimpleRegistry
contains, containsId, createEntry, createMutableRegistryLookup, freeze, get, getEntry, getEntry, getEntry, getEntryInfo, getEntrySet, getIds, getKey, getKey, getKeys, getLifecycle, getOptional, getOptional, getOrCreateEntry, getTag, getTags, isEmpty, iterator, refreshTags, resetTagEntries, setEntries, size, startTagReload, streamEntries, streamTags, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.util.collection.IndexedIterable
getOrThrow, getRawIdOrThrow, sizeMethods inherited from interface java.lang.Iterable
forEach, iterator, spliteratorMethods inherited from interface net.minecraft.registry.Registry
contains, containsId, createEntry, freeze, get, getCodec, getEntry, getEntry, getEntry, getEntryCodec, getEntryInfo, getEntrySet, getIds, getIndexedEntries, getKey, getKey, getKeys, getOptionalValue, getRandomEntry, getValueOrThrow, iterateEntries, keys, startTagReload, stream, streamTagsMethods 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
-
Field Details
-
defaultId
- Mappings:
Namespace Name Mixin selector named defaultIdLnet/minecraft/registry/SimpleDefaultedRegistry;defaultId:Lnet/minecraft/util/Identifier;intermediary field_11014Lnet/minecraft/class_2348;field_11014:Lnet/minecraft/class_2960;official bLjl;b:Lakv;
-
defaultEntry
- Mappings:
Namespace Name Mixin selector named defaultEntryLnet/minecraft/registry/SimpleDefaultedRegistry;defaultEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary field_11015Lnet/minecraft/class_2348;field_11015:Lnet/minecraft/class_6880$class_6883;official cLjl;c:Ljr$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)Vintermediary <init>Lnet/minecraft/class_2348;<init>(Ljava/lang/String;Lnet/minecraft/class_5321;Lcom/mojang/serialization/Lifecycle;Z)Vofficial <init>Ljl;<init>(Ljava/lang/String;Laku;Lcom/mojang/serialization/Lifecycle;Z)V
-
-
Method Details
-
add
- Specified by:
addin interfaceMutableRegistry<T>- Overrides:
addin classSimpleRegistry<T>- Mappings:
Namespace Name Mixin selector named addLnet/minecraft/registry/MutableRegistry;add(Lnet/minecraft/registry/RegistryKey;Ljava/lang/Object;Lnet/minecraft/registry/entry/RegistryEntryInfo;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;intermediary method_10272Lnet/minecraft/class_2385;method_10272(Lnet/minecraft/class_5321;Ljava/lang/Object;Lnet/minecraft/class_9248;)Lnet/minecraft/class_6880$class_6883;official aLkn;a(Laku;Ljava/lang/Object;Lkd;)Ljr$c;
-
getRawId
- Specified by:
getRawIdin interfaceIndexedIterable<T>- Specified by:
getRawIdin interfaceRegistry<T>- Overrides:
getRawIdin classSimpleRegistry<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 aLjw;a(Ljava/lang/Object;)I
-
getId
Returns the ID assigned tovalue, ornullif it is not registered.- Specified by:
getIdin interfaceDefaultedRegistry<T>- Specified by:
getIdin interfaceRegistry<T>- Overrides:
getIdin classSimpleRegistry<T>- 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 bLke;b(Ljava/lang/Object;)Lakv;
-
get
Returns the value that is assignedid, ornullif there is none.- Specified by:
getin interfaceDefaultedRegistry<T>- Specified by:
getin interfaceRegistry<T>- Overrides:
getin classSimpleRegistry<T>- 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 aLke;a(Lakv;)Ljava/lang/Object;
-
getOptionalValue
Returns the value that is assignedid, or an empty optional if there is none.- Specified by:
getOptionalValuein interfaceRegistry<T>- 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 bLke;b(Lakv;)Ljava/util/Optional;
-
getDefaultEntry
- Specified by:
getDefaultEntryin interfaceRegistry<T>- Overrides:
getDefaultEntryin classSimpleRegistry<T>- 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 aLke;a()Ljava/util/Optional;
-
get
- Specified by:
getin interfaceDefaultedRegistry<T>- Specified by:
getin interfaceIndexedIterable<T>- Overrides:
getin classSimpleRegistry<T>- Mappings:
Namespace Name Mixin selector named getLnet/minecraft/util/collection/IndexedIterable;get(I)Ljava/lang/Object;intermediary method_10200Lnet/minecraft/class_2359;method_10200(I)Ljava/lang/Object;official aLjw;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:
getRandomin interfaceRegistry<T>- Overrides:
getRandomin 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 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 aLke;a(Lazh;)Ljava/util/Optional;
-
getDefaultId
- Specified by:
getDefaultIdin interfaceDefaultedRegistry<T>- Mappings:
Namespace Name Mixin selector named getDefaultIdLnet/minecraft/registry/DefaultedRegistry;getDefaultId()Lnet/minecraft/util/Identifier;intermediary method_10137Lnet/minecraft/class_7922;method_10137()Lnet/minecraft/class_2960;official bLjm;b()Lakv;
-