Package net.minecraft.core
Class DefaultedMappedRegistry<T>
java.lang.Object
net.neoforged.neoforge.registries.BaseMappedRegistry<T>
net.minecraft.core.MappedRegistry<T>
net.minecraft.core.DefaultedMappedRegistry<T>
- All Implemented Interfaces:
com.mojang.serialization.Keyable
,Iterable<T>
,DefaultedRegistry<T>
,HolderGetter<T>
,HolderLookup<T>
,HolderLookup.RegistryLookup<T>
,HolderOwner<T>
,IdMap<T>
,Registry<T>
,WritableRegistry<T>
,IRegistryExtension<T>
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.core.MappedRegistry
MappedRegistry.TagSet<T>
Nested classes/interfaces inherited from interface net.minecraft.core.HolderLookup
HolderLookup.Provider, HolderLookup.RegistryLookup<T>
Nested classes/interfaces inherited from interface net.minecraft.core.HolderLookup.RegistryLookup
HolderLookup.RegistryLookup.Delegate<T>
Nested classes/interfaces inherited from interface net.minecraft.core.Registry
Registry.PendingTags<T>
-
Field Summary
FieldsFields inherited from class net.minecraft.core.MappedRegistry
allTags
Fields inherited from class net.neoforged.neoforge.registries.BaseMappedRegistry
addCallbacks, bakeCallbacks, clearCallbacks
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultedMappedRegistry
(String p_260196_, ResourceKey<? extends Registry<T>> p_259440_, com.mojang.serialization.Lifecycle p_260260_, boolean p_259808_) -
Method Summary
Modifier and TypeMethodDescriptionbyId
(int p_259534_) getAny()
int
getKeyOrNull
(T element) Returns the key of the element, or null if it is not present in this registry.getOptional
(ResourceLocation p_260078_) getRandom
(RandomSource p_260255_) getValue
(ResourceLocation p_368576_) register
(ResourceKey<T> p_321803_, T p_321739_, RegistrationInfo p_325995_) Methods inherited from class net.minecraft.core.MappedRegistry
bindAllTagsToEmpty, bindTag, clear, containsKey, containsKey, containsValue, createIntrusiveHolder, createRegistrationLookup, entrySet, freeze, get, get, get, get, getId, getId, getOrCreateHolderOrThrow, getOrCreateTagForRegistration, getResourceKey, getTags, getValue, isEmpty, iterator, key, keySet, listElements, listTags, prepareTagReload, refreshTagsInHolders, register, registerIdMapping, registrationInfo, registryKeySet, registryLifecycle, size, toString, unfreeze, wrapAsHolder
Methods inherited from class net.neoforged.neoforge.registries.BaseMappedRegistry
addAlias, addCallback, doesSync, getData, getDataMap, getDataMaps, getMaxId, resolve, resolve
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.HolderGetter
get, get, getOrThrow, getOrThrow
Methods inherited from interface net.minecraft.core.HolderLookup
listElementIds, listElements, listTagIds, listTags
Methods inherited from interface net.minecraft.core.HolderLookup.RegistryLookup
filterElements, filterFeatures, getData, registryLifecycle
Methods inherited from interface net.minecraft.core.HolderOwner
canSerializeIn
Methods inherited from interface net.minecraft.core.IdMap
byIdOrThrow, getIdOrThrow, size
Methods inherited from interface net.neoforged.neoforge.registries.IRegistryExtension
addAlias, addCallback, addCallback, containsValue, doesSync, getDataMap, getId, getId, getMaxId, resolve, resolve
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
Methods inherited from interface net.minecraft.core.Registry
asHolderIdMap, byNameCodec, containsKey, containsKey, createIntrusiveHolder, entrySet, freeze, get, get, getOptional, getRandomElementOf, getResourceKey, getTagOrEmpty, getTags, getValue, getValueOrThrow, holderByNameCodec, key, keys, keySet, prepareTagReload, registrationInfo, registryKeySet, stream, wrapAsHolder
-
Field Details
-
defaultKey
-
defaultValue
-
-
Constructor Details
-
DefaultedMappedRegistry
public DefaultedMappedRegistry(String p_260196_, ResourceKey<? extends Registry<T>> p_259440_, com.mojang.serialization.Lifecycle p_260260_, boolean p_259808_)
-
-
Method Details
-
register
public Holder.Reference<T> register(ResourceKey<T> p_321803_, T p_321739_, RegistrationInfo p_325995_) - Specified by:
register
in interfaceWritableRegistry<T>
- Overrides:
register
in classMappedRegistry<T>
-
getId
-
getKey
- Specified by:
getKey
in interfaceDefaultedRegistry<T>
- Specified by:
getKey
in interfaceRegistry<T>
- Overrides:
getKey
in classMappedRegistry<T>
-
getKeyOrNull
Description copied from interface:IRegistryExtension
Returns the key of the element, or null if it is not present in this registry.- Specified by:
getKeyOrNull
in interfaceIRegistryExtension<T>
- Returns:
- the key of the element, or null if it is not present in this registry
-
getValue
- Specified by:
getValue
in interfaceDefaultedRegistry<T>
- Specified by:
getValue
in interfaceRegistry<T>
- Overrides:
getValue
in classMappedRegistry<T>
-
getOptional
- Specified by:
getOptional
in interfaceRegistry<T>
-
getAny
-
byId
- Specified by:
byId
in interfaceDefaultedRegistry<T>
- Specified by:
byId
in interfaceIdMap<T>
- Overrides:
byId
in classMappedRegistry<T>
-
getRandom
-
getDefaultKey
- Specified by:
getDefaultKey
in interfaceDefaultedRegistry<T>
-