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 - official - gy- intermediary - net/minecraft/class_2348- named - net/minecraft/registry/SimpleDefaultedRegistry
- 
Field SummaryFieldsFields inherited from class net.minecraft.registry.SimpleRegistrykeyFields inherited from interface net.minecraft.util.collection.IndexedIterableABSENT_RAW_ID
- 
Constructor SummaryConstructorsConstructorDescriptionSimpleDefaultedRegistry(String defaultId, RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusive) 
- 
Method SummaryModifier and TypeMethodDescriptionget(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.intset(int int2, RegistryKey<T> registryKey, T t, com.mojang.serialization.Lifecycle lifecycle) Methods inherited from class net.minecraft.registry.SimpleRegistryadd, clearTags, contains, containsId, createEntry, createMutableEntryLookup, freeze, get, getEntry, getEntry, getEntry, getEntryLifecycle, getEntryList, getEntryOwner, getEntrySet, getIds, getKey, getKey, getKeys, getLifecycle, getOrCreateEntry, getOrCreateEntryList, getReadOnlyWrapper, isEmpty, iterator, populateTags, size, streamEntries, streamTags, streamTagsAndEntries, toStringMethods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.util.collection.IndexedIterablegetOrThrow, sizeMethods inherited from interface java.lang.IterableforEach, iterator, spliteratorMethods inherited from interface net.minecraft.registry.RegistryclearTags, contains, containsId, createEntry, createEntryCodec, entryOf, freeze, get, getCodec, getEntry, getEntry, getEntry, getEntryLifecycle, getEntryList, getEntryOwner, getEntrySet, getIds, getIndexedEntries, getKey, getKey, getKeys, getLifecycle, getOrCreateEntryList, getOrEmpty, getOrThrow, getReadOnlyWrapper, getTagCreatingWrapper, iterateEntries, keys, populateTags, stream, streamEntries, streamTags, streamTagsAndEntries
- 
Field Details- 
defaultId- Mappings:
- Namespace - Name - Mixin selector - official - b- Lgy;b:Lacq;- intermediary - field_11014- Lnet/minecraft/class_2348;field_11014:Lnet/minecraft/class_2960;- named - defaultId- Lnet/minecraft/registry/SimpleDefaultedRegistry;defaultId:Lnet/minecraft/util/Identifier;
 
- 
defaultEntry- Mappings:
- Namespace - Name - Mixin selector - official - c- Lgy;c:Lhe$c;- intermediary - field_11015- Lnet/minecraft/class_2348;field_11015:Lnet/minecraft/class_6880$class_6883;- named - defaultEntry- Lnet/minecraft/registry/SimpleDefaultedRegistry;defaultEntry:Lnet/minecraft/registry/entry/RegistryEntry$Reference;
 
 
- 
- 
Constructor Details- 
SimpleDefaultedRegistrypublic SimpleDefaultedRegistry(String defaultId, RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusive) - Mappings:
- Namespace - Name - Mixin selector - official - <init>- Lgy;<init>(Ljava/lang/String;Lacp;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- named - <init>- Lnet/minecraft/registry/SimpleDefaultedRegistry;<init>(Ljava/lang/String;Lnet/minecraft/registry/RegistryKey;Lcom/mojang/serialization/Lifecycle;Z)V
 
 
- 
- 
Method Details- 
setpublic RegistryEntry.Reference<T> set(int int2, RegistryKey<T> registryKey, T t, com.mojang.serialization.Lifecycle lifecycle) - Specified by:
- setin interface- MutableRegistry<T>
- Overrides:
- setin class- SimpleRegistry<T>
- Mappings:
- Namespace - Name - Mixin selector - official - method_46744- Lgy;method_46744(ILacp;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lhe$c;- intermediary - method_46744- Lnet/minecraft/class_2348;method_46744(ILnet/minecraft/class_5321;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/class_6880$class_6883;- named - set- Lnet/minecraft/registry/SimpleDefaultedRegistry;set(ILnet/minecraft/registry/RegistryKey;Ljava/lang/Object;Lcom/mojang/serialization/Lifecycle;)Lnet/minecraft/registry/entry/RegistryEntry$Reference;
 
- 
getRawId- Specified by:
- getRawIdin interface- IndexedIterable<T>
- Specified by:
- getRawIdin interface- Registry<T>
- Overrides:
- getRawIdin class- SimpleRegistry<T>
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lhj;a(Ljava/lang/Object;)I- intermediary - method_10206- Lnet/minecraft/class_2359;method_10206(Ljava/lang/Object;)I- named - getRawId- Lnet/minecraft/util/collection/IndexedIterable;getRawId(Ljava/lang/Object;)I
 
- 
getIdReturns the ID assigned tovalue, ornullif it is not registered.- Specified by:
- getIdin interface- DefaultedRegistry<T>
- Specified by:
- getIdin interface- Registry<T>
- Overrides:
- getIdin class- SimpleRegistry<T>
- Returns:
- the ID assigned to value, ornullif it is not registered
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lhr;b(Ljava/lang/Object;)Lacq;- intermediary - method_10221- Lnet/minecraft/class_2378;method_10221(Ljava/lang/Object;)Lnet/minecraft/class_2960;- named - getId- Lnet/minecraft/registry/Registry;getId(Ljava/lang/Object;)Lnet/minecraft/util/Identifier;
 
- 
getReturns the value that is assignedid, ornullif there is none.- Specified by:
- getin interface- DefaultedRegistry<T>
- Specified by:
- getin interface- Registry<T>
- Overrides:
- getin class- SimpleRegistry<T>
- Returns:
- the value that is assigned id, ornullif there is none
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lhr;a(Lacq;)Ljava/lang/Object;- intermediary - method_10223- Lnet/minecraft/class_2378;method_10223(Lnet/minecraft/class_2960;)Ljava/lang/Object;- named - get- Lnet/minecraft/registry/Registry;get(Lnet/minecraft/util/Identifier;)Ljava/lang/Object;
 
- 
getOrEmptyReturns the value that is assignedid, or an empty optional if there is none.- Specified by:
- getOrEmptyin interface- Registry<T>
- Returns:
- the value that is assigned id, or an empty optional if there is none
- Mappings:
- Namespace - Name - Mixin selector - official - b- Lhr;b(Lacq;)Ljava/util/Optional;- intermediary - method_17966- Lnet/minecraft/class_2378;method_17966(Lnet/minecraft/class_2960;)Ljava/util/Optional;- named - getOrEmpty- Lnet/minecraft/registry/Registry;getOrEmpty(Lnet/minecraft/util/Identifier;)Ljava/util/Optional;
 
- 
get- Specified by:
- getin interface- DefaultedRegistry<T>
- Specified by:
- getin interface- IndexedIterable<T>
- Overrides:
- getin class- SimpleRegistry<T>
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lhj;a(I)Ljava/lang/Object;- intermediary - method_10200- Lnet/minecraft/class_2359;method_10200(I)Ljava/lang/Object;- named - get- Lnet/minecraft/util/collection/IndexedIterable;get(I)Ljava/lang/Object;
 
- 
getRandomReturns a random registry entry from this registry, or an empty optional if the registry is empty.- Specified by:
- getRandomin interface- Registry<T>
- Overrides:
- getRandomin class- SimpleRegistry<T>
- Returns:
- a random registry entry from this registry, or an empty optional if the registry is empty
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lhr;a(Lapf;)Ljava/util/Optional;- intermediary - method_10240- Lnet/minecraft/class_2378;method_10240(Lnet/minecraft/class_5819;)Ljava/util/Optional;- named - getRandom- Lnet/minecraft/registry/Registry;getRandom(Lnet/minecraft/util/math/random/Random;)Ljava/util/Optional;
 
- 
getDefaultId- Specified by:
- getDefaultIdin interface- DefaultedRegistry<T>
- Mappings:
- Namespace - Name - Mixin selector - official - a- Lgz;a()Lacq;- intermediary - method_10137- Lnet/minecraft/class_7922;method_10137()Lnet/minecraft/class_2960;- named - getDefaultId- Lnet/minecraft/registry/DefaultedRegistry;getDefaultId()Lnet/minecraft/util/Identifier;
 
 
-