net.minecraft.registry

public class SimpleRegistry<T>

implements MutableRegistry<T>

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

Field summary

Modifier and TypeField
private final RegistryKey<? extends Registry<T>>
key
key
field_41126
key
private final it.unimi.dsi.fastutil.objects.ObjectList<RegistryEntry$Reference<T>>
byId
byId
field_26682
rawIdToEntry
private final it.unimi.dsi.fastutil.objects.Reference2IntMap<T>
toId
toId
field_26683
entryToRawId
private final Map<Identifier, RegistryEntry$Reference<T>>
byLocation
byLocation
field_11107
idToEntry
private final Map<RegistryKey<T>, RegistryEntry$Reference<T>>
byKey
byKey
field_25067
keyToEntry
private final Map<T, RegistryEntry$Reference<T>>
byValue
byValue
field_36461
valueToEntry
private final Map<RegistryKey<T>, RegistryEntryInfo>
registrationInfos
registrationInfos
field_49135
keyToEntryInfo
private com.mojang.serialization.Lifecycle
registryLifecycle
registryLifecycle
field_26732
lifecycle
private final Map<TagKey<T>, RegistryEntryList$Named<T>>
frozenTags
frozenTags
field_53686
tags
private SimpleRegistry$TagLookup<T>
allTags
allTags
field_53687
tagLookup
private ReverseComponentLookup<T>
componentLookup
componentLookup
field_1_958
reverseLookup
private boolean
frozen
frozen
field_36463
frozen
private Map<T, RegistryEntry$Reference<T>>
unregisteredIntrusiveHolders
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()
listTags()
method_42020()
tags()
public RegistryKey<? extends Registry<T>>
key()
key()
method_46765()
getKey()
private void
validateWrite()
validateWrite()
method_45939()
assertNotFrozen()
private void
validateWrite(ResourceKey<T> key)
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)
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)
getKey(T thing)
method_10221(T arg0)
getId(T arg0)
public Optional<RegistryKey<T>>
getResourceKey(T thing)
getResourceKey(T thing)
method_29113(T arg0)
getKey(T arg0)
public int
getId(T thing)
getId(T thing)
method_10206(T arg0)
getRawId(T arg0)
public T
getValue(ResourceKey<T> key)
getValue(ResourceKey<T> key)
method_29107(class_5321<T> arg0)
get(RegistryKey<T> arg0)
public T
byId(int id)
byId(int id)
method_10200(int arg0)
get(int arg0)
public Optional<RegistryEntry$Reference<T>>
get(int id)
get(int id)
method_40265(int arg0)
getEntry(int arg0)
public Optional<RegistryEntry$Reference<T>>
get(Identifier id)
get(Identifier id)
method_10223(class_2960 arg0)
getEntry(Identifier arg0)
public Optional<RegistryEntry$Reference<T>>
get(ResourceKey<T> id)
get(ResourceKey<T> id)
method_46746(class_5321<T> arg0)
getOptional(RegistryKey<T> arg0)
public Optional<RegistryEntry$Reference<T>>
getAny()
getAny()
method_60385()
getDefaultEntry()
public RegistryEntry<T>
wrapAsHolder(T value)
wrapAsHolder(T value)
method_47983(T arg0)
getEntry(T arg0)
private RegistryEntry$Reference<T>
getOrCreateHolderOrThrow(ResourceKey<T> key)
getOrCreateHolderOrThrow(ResourceKey<T> key)
method_44298(class_5321<T> arg0)
getOrCreateEntry(RegistryKey<T> key)
public int
size()
size()
method_10204()
size()
public Optional<RegistryEntryInfo>
registrationInfo(ResourceKey<T> element)
registrationInfo(ResourceKey<T> element)
method_57058(class_5321<T> arg0)
getEntryInfo(RegistryKey<T> arg0)
public com.mojang.serialization.Lifecycle
registryLifecycle()
registryLifecycle()
method_46766()
getLifecycle()
public Iterator<T>
iterator()
iterator()
public T
getValue(Identifier key)
getValue(Identifier key)
method_63535(class_2960 arg0)
get(Identifier arg0)
private static <T> T
getValueFromNullable(Holder$Reference<T> result)
getValueFromNullable(Holder$Reference<T> result)
method_40253(class_6880$class_6883<T> arg0)
getValue(RegistryEntry$Reference<T> entry)
public Set<Identifier>
keySet()
keySet()
method_10235()
getIds()
public Set<RegistryKey<T>>
registryKeySet()
registryKeySet()
method_42021()
getKeys()
public Set<Map$Entry<RegistryKey<T>, T>>
entrySet()
entrySet()
method_29722()
getEntrySet()
public Stream<RegistryEntry$Reference<T>>
listElements()
listElements()
method_42017()
streamEntries()
public Stream<RegistryEntryList$Named<T>>
getTags()
getTags()
method_40272()
streamTags()
private RegistryEntryList$Named<T>
getOrCreateTagForRegistration(TagKey<T> tag)
getOrCreateTagForRegistration(TagKey<T> tag)
method_62690(class_6862<T> arg0)
getTag(TagKey<T> key)
private RegistryEntryList$Named<T>
createTag(TagKey<T> tag)
createTag(TagKey<T> tag)
method_40562(class_6862<T> arg0)
createNamedEntryList(TagKey<T> tag)
public boolean
isEmpty()
isEmpty()
method_35863()
isEmpty()
public Optional<RegistryEntry$Reference<T>>
getRandom(RandomSource random)
getRandom(RandomSource random)
method_10240(class_5819 arg0)
getRandom(Random arg0)
public boolean
containsKey(Identifier key)
containsKey(Identifier key)
method_10250(class_2960 arg0)
containsId(Identifier arg0)
public boolean
containsKey(ResourceKey<T> key)
containsKey(ResourceKey<T> key)
method_35842(class_5321<T> arg0)
contains(RegistryKey<T> arg0)
public ReverseComponentLookup<T>
componentLookup()
componentLookup()
method_1_819()
getReverseComponentLookup()
public Registry<T>
freeze()
freeze()
method_40276()
freeze()
public RegistryEntry$Reference<T>
createIntrusiveHolder(T value)
createIntrusiveHolder(T value)
method_40269(T arg0)
createEntry(T arg0)
public Optional<RegistryEntryList$Named<T>>
get(TagKey<T> id)
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)
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)
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()
refreshTagsInHolders()
method_62692()
refreshTags()
public void
bindAllTagsToEmpty()
bindAllTagsToEmpty()
method_62691()
resetTagEntries()
public RegistryEntryLookup<T>
createRegistrationLookup()
createRegistrationLookup()
method_46769()
createMutableRegistryLookup()
public Registry$PendingTagLoad<T>
prepareTagReload(TagLoader$LoadResult<T> tags)
prepareTagReload(TagLoader$LoadResult<T> tags)
method_62683(class_3503$class_6863<T> arg0)
startTagReload(TagGroupLoader$RegistryTags<T> arg0)