net.minecraft.registry

public class SimpleRegistry<T>

implements MutableRegistry<T>

net.minecraft.core.MappedRegistry
net.minecraft.class_2370
net.minecraft.registry.SimpleRegistry

Field summary

Modifier and TypeField
private final RegistryKey<? extends Registry<T>>
key
field_41126
key
private final it.unimi.dsi.fastutil.objects.ObjectList<RegistryEntry$Reference<T>>
byId
field_26682
rawIdToEntry
private final it.unimi.dsi.fastutil.objects.Reference2IntMap<T>
toId
field_26683
entryToRawId
private final Map<Identifier, RegistryEntry$Reference<T>>
byLocation
field_11107
idToEntry
private final Map<RegistryKey<T>, RegistryEntry$Reference<T>>
byKey
field_25067
keyToEntry
private final Map<T, RegistryEntry$Reference<T>>
byValue
field_36461
valueToEntry
private final Map<RegistryKey<T>, RegistryEntryInfo>
registrationInfos
field_49135
keyToEntryInfo
private com.mojang.serialization.Lifecycle
registryLifecycle
field_26732
lifecycle
private final Map<TagKey<T>, RegistryEntryList$Named<T>>
frozenTags
field_53686
tags
private SimpleRegistry$TagLookup<T>
allTags
field_53687
tagLookup
private ReverseComponentLookup<T>
componentLookup
field_1_958
reverseLookup
private boolean
frozen
field_36463
frozen
private Map<T, RegistryEntry$Reference<T>>
unregisteredIntrusiveHolders
field_40584
intrusiveValueToEntry

Constructor summary

ModifierConstructor
public (RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle)
public (RegistryKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusive)

Method summary

Modifier and TypeMethod
public Stream<RegistryEntryList$Named<T>>
listTags()
method_42020()
tags()
public RegistryKey<? extends Registry<T>>
key()
method_46765()
getKey()
private void
validateWrite()
method_45939()
assertNotFrozen()
private void
validateWrite(ResourceKey<T> key)
method_40274(class_5321<T> arg0)
assertNotFrozen(RegistryKey<T> key)
public RegistryEntry$Reference<T>
register(ResourceKey<T> key, T value, RegistrationInfo registrationInfo)
method_10272(class_5321<T> arg0, T arg1, class_9248 arg2)
add(RegistryKey<T> arg0, T arg1, RegistryEntryInfo arg2)
public Identifier
getKey(T thing)
method_10221(T arg0)
getId(T arg0)
public Optional<RegistryKey<T>>
getResourceKey(T thing)
method_29113(T arg0)
getKey(T arg0)
public int
getId(T thing)
method_10206(T arg0)
getRawId(T arg0)
public T
getValue(ResourceKey<T> key)
method_29107(class_5321<T> arg0)
get(RegistryKey<T> arg0)
public T
byId(int id)
method_10200(int arg0)
get(int arg0)
public Optional<RegistryEntry$Reference<T>>
get(int id)
method_40265(int arg0)
getEntry(int arg0)
public Optional<RegistryEntry$Reference<T>>
get(Identifier id)
method_10223(class_2960 arg0)
getEntry(Identifier arg0)
public Optional<RegistryEntry$Reference<T>>
get(ResourceKey<T> id)
method_46746(class_5321<T> arg0)
getOptional(RegistryKey<T> arg0)
public Optional<RegistryEntry$Reference<T>>
getAny()
method_60385()
getDefaultEntry()
public RegistryEntry<T>
wrapAsHolder(T value)
method_47983(T arg0)
getEntry(T arg0)
private RegistryEntry$Reference<T>
getOrCreateHolderOrThrow(ResourceKey<T> key)
method_44298(class_5321<T> arg0)
getOrCreateEntry(RegistryKey<T> key)
public int
size()
method_10204()
size()
public Optional<RegistryEntryInfo>
registrationInfo(ResourceKey<T> element)
method_57058(class_5321<T> arg0)
getEntryInfo(RegistryKey<T> arg0)
public com.mojang.serialization.Lifecycle
registryLifecycle()
method_46766()
getLifecycle()
public Iterator<T>
iterator()
public T
getValue(Identifier key)
method_63535(class_2960 arg0)
get(Identifier arg0)
private static <T> T
getValueFromNullable(Holder$Reference<T> result)
method_40253(class_6880$class_6883<T> arg0)
getValue(RegistryEntry$Reference<T> entry)
public Set<Identifier>
keySet()
method_10235()
getIds()
public Set<RegistryKey<T>>
registryKeySet()
method_42021()
getKeys()
public Set<Map$Entry<RegistryKey<T>, T>>
entrySet()
method_29722()
getEntrySet()
public Stream<RegistryEntry$Reference<T>>
listElements()
method_42017()
streamEntries()
public Stream<RegistryEntryList$Named<T>>
getTags()
method_40272()
streamTags()
private RegistryEntryList$Named<T>
getOrCreateTagForRegistration(TagKey<T> tag)
method_62690(class_6862<T> arg0)
getTag(TagKey<T> key)
private RegistryEntryList$Named<T>
createTag(TagKey<T> tag)
method_40562(class_6862<T> arg0)
createNamedEntryList(TagKey<T> tag)
public boolean
isEmpty()
method_35863()
isEmpty()
public Optional<RegistryEntry$Reference<T>>
getRandom(RandomSource random)
method_10240(class_5819 arg0)
getRandom(Random arg0)
public boolean
containsKey(Identifier key)
method_10250(class_2960 arg0)
containsId(Identifier arg0)
public boolean
containsKey(ResourceKey<T> key)
method_35842(class_5321<T> arg0)
contains(RegistryKey<T> arg0)
public ReverseComponentLookup<T>
componentLookup()
method_1_819()
getReverseComponentLookup()
public Registry<T>
freeze()
method_40276()
freeze()
public RegistryEntry$Reference<T>
createIntrusiveHolder(T value)
method_40269(T arg0)
createEntry(T arg0)
public Optional<RegistryEntryList$Named<T>>
get(TagKey<T> id)
method_46733(class_6862<T> arg0)
getOptional(TagKey<T> arg0)
private RegistryEntry$Reference<T>
validateAndUnwrapTagElement(TagKey<T> id, Holder<T> value)
method_62682(class_6862<T> arg0, class_6880<T> arg1)
ensureTagable(TagKey<T> key, RegistryEntry<T> entry)
public void
bindTags(Map<TagKey<T>, List<Holder<T>>> pendingTags)
method_62681(Map<class_6862<T>, List<class_6880<T>>> arg0)
setEntries(Map<TagKey<T>, List<RegistryEntry<T>>> arg0)
private void
refreshTagsInHolders()
method_62692()
refreshTags()
public void
bindAllTagsToEmpty()
method_62691()
resetTagEntries()
public RegistryEntryLookup<T>
createRegistrationLookup()
method_46769()
createMutableRegistryLookup()
public Registry$PendingTagLoad<T>
prepareTagReload(TagLoader$LoadResult<T> tags)
method_62683(class_3503$class_6863<T> arg0)
startTagReload(TagGroupLoader$RegistryTags<T> arg0)
private void
lambda$prepareTagReload$0(com.google.common.collect.ImmutableMap$Builder arg0, Map arg1, TagKey arg2, List arg3)
method_62684(com.google.common.collect.ImmutableMap$Builder arg0, Map arg1, class_6862 arg2, List arg3)
method_62684(com.google.common.collect.ImmutableMap$Builder arg0, Map arg1, TagKey key, List values)
private static void
lambda$bindAllTagsToEmpty$0(HolderSet$Named arg0)
method_62688(class_6885$class_6888 arg0)
method_62688(RegistryEntryList$Named tag)
private void
lambda$refreshTagsInHolders$1(Map arg0, TagKey arg1, HolderSet$Named arg2)
method_62686(Map arg0, class_6862 arg1, class_6885$class_6888 arg2)
method_62686(Map arg0, TagKey key, RegistryEntryList$Named value)
private static void
lambda$refreshTagsInHolders$0(Map arg0, Holder$Reference arg1)
method_62687(Map arg0, class_6880$class_6883 arg1)
method_62687(Map arg0, RegistryEntry$Reference key)
private void
lambda$bindTags$0(TagKey arg0, List arg1)
method_1_382(class_6862 arg0, List arg1)
method_1_382(TagKey tag, List tagEntries)
private RegistryEntry$Reference
lambda$createIntrusiveHolder$0(Object arg0)
method_40271(Object arg0)
method_40271(Object valuex)
private static Identifier
lambda$freeze$4(Map$Entry arg0)
method_62685(Map$Entry arg0)
method_62685(Map$Entry entry)
private static boolean
lambda$freeze$3(Map$Entry arg0)
method_62689(Map$Entry arg0)
method_62689(Map$Entry entry)
private static Identifier
lambda$freeze$2(Map$Entry arg0)
method_41199(Map$Entry arg0)
method_41199(Map$Entry entry)
private static boolean
lambda$freeze$1(Map$Entry arg0)
method_40256(Map$Entry arg0)
method_40256(Map$Entry entry)
private static void
lambda$freeze$0(Object arg0, Holder$Reference arg1)
method_45938(Object arg0, class_6880$class_6883 arg1)
method_45938(Object value, RegistryEntry$Reference entry)
private RegistryEntry$Reference
lambda$getOrCreateHolderOrThrow$0(ResourceKey arg0)
method_44299(class_5321 arg0)
method_44299(RegistryKey key2)
private RegistryEntry$Reference
lambda$register$0(ResourceKey arg0)
method_56594(class_5321 arg0)
method_56594(RegistryKey k)
private static void
lambda$new$0(it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap arg0)
method_39665(it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap arg0)
method_39665(it.unimi.dsi.fastutil.objects.Reference2IntOpenHashMap map)