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 interface HolderLookup
HolderLookup.Provider, HolderLookup.RegistryLookup<T>Nested classes/interfaces inherited from interface HolderLookup.RegistryLookup
HolderLookup.RegistryLookup.Delegate<T>Nested classes/interfaces inherited from interface Registry
Registry.PendingTags<T> -
Field Summary
FieldsFields inherited from class BaseMappedRegistry
addCallbacks, bakeCallbacks, clearCallbacks -
Constructor Summary
ConstructorsConstructorDescriptionDefaultedMappedRegistry(String defaultKey, ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusiveHolders) -
Method Summary
Modifier and TypeMethodDescriptionbyId(int id) getAny()int@Nullable IdentifiergetKeyOrNull(T element) Returns the key of the element, or null if it is not present in this registry.getOptional(@Nullable Identifier key) getRandom(RandomSource random) getValue(@Nullable Identifier key) register(ResourceKey<T> key, T value, RegistrationInfo registrationInfo) Methods inherited from class MappedRegistry
bindAllTagsToEmpty, bindTags, clear, componentLookup, containsKey, containsKey, containsValue, createIntrusiveHolder, createRegistrationLookup, entrySet, freeze, get, get, get, get, getId, getId, getResourceKey, getTags, getValue, isEmpty, iterator, key, keySet, listElements, listTags, prepareTagReload, register, registerIdMapping, registrationInfo, registryKeySet, registryLifecycle, size, toString, unfreeze, wrapAsHolderMethods inherited from class BaseMappedRegistry
addAlias, addCallback, doesSync, getData, getDataMap, getDataMaps, getMaxId, resolve, resolveMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface HolderGetter
get, get, getOrThrow, getOrThrow, getRandomElementOfMethods inherited from interface HolderLookup
listElementIds, listElements, listTagIds, listTagsMethods inherited from interface HolderLookup.RegistryLookup
filterElements, filterFeatures, getData, registryLifecycleMethods inherited from interface HolderOwner
canSerializeInMethods inherited from interface IdMap
byIdOrThrow, getIdOrThrow, sizeMethods inherited from interface IRegistryExtension
addAlias, addCallback, addCallback, containsValue, doesSync, getDataMap, getId, getId, getMaxId, resolve, resolveMethods inherited from interface Iterable
forEach, iterator, spliteratorMethods inherited from interface Registry
asHolderIdMap, byNameCodec, componentLookup, containsKey, containsKey, createIntrusiveHolder, entrySet, freeze, get, get, getOptional, getResourceKey, getTagOrEmpty, getTags, getValue, getValueOrThrow, holderByNameCodec, key, keys, keySet, prepareTagReload, registrationInfo, registryKeySet, stream, wrapAsHolder
-
Field Details
-
defaultKey
-
defaultValue
-
-
Constructor Details
-
DefaultedMappedRegistry
public DefaultedMappedRegistry(String defaultKey, ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle lifecycle, boolean intrusiveHolders)
-
-
Method Details
-
register
- Specified by:
registerin interfaceWritableRegistry<T>- Overrides:
registerin classMappedRegistry<T>
-
getId
-
getKey
- Specified by:
getKeyin interfaceDefaultedRegistry<T>- Specified by:
getKeyin interfaceRegistry<T>- Overrides:
getKeyin classMappedRegistry<T>- Returns:
- the name used to identify the given object within this registry or
nullif the object is not within this registry
-
getKeyOrNull
Description copied from interface:IRegistryExtensionReturns the key of the element, or null if it is not present in this registry.- Specified by:
getKeyOrNullin interfaceIRegistryExtension<T>- Returns:
- the key of the element, or null if it is not present in this registry
-
getValue
- Specified by:
getValuein interfaceDefaultedRegistry<T>- Specified by:
getValuein interfaceRegistry<T>- Overrides:
getValuein classMappedRegistry<T>
-
getOptional
- Specified by:
getOptionalin interfaceRegistry<T>
-
getAny
-
byId
- Specified by:
byIdin interfaceDefaultedRegistry<T>- Specified by:
byIdin interfaceIdMap<T>- Overrides:
byIdin classMappedRegistry<T>
-
getRandom
-
getDefaultKey
- Specified by:
getDefaultKeyin interfaceDefaultedRegistry<T>
-