Package net.minecraft.core
Interface Registry<T>
- All Superinterfaces:
HolderGetter<T>,HolderLookup<T>,HolderLookup.RegistryLookup<T>,HolderOwner<T>,IdMap<T>,IRegistryExtension<T>,Iterable<T>,com.mojang.serialization.Keyable
- All Known Subinterfaces:
DefaultedRegistry<T>,WritableRegistry<T>
- All Known Implementing Classes:
BaseMappedRegistry,DefaultedMappedRegistry,MappedRegistry
public interface Registry<T>
extends com.mojang.serialization.Keyable, HolderLookup.RegistryLookup<T>, IdMap<T>, IRegistryExtension<T>
-
Nested Class Summary
Nested ClassesNested 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> -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptiondefault com.mojang.serialization.Codec<T> booleancontainsKey(ResourceKey<T> pKey) booleancontainsKey(ResourceLocation pName) createIntrusiveHolder(T pValue) Set<Map.Entry<ResourceKey<T>, T>> entrySet()freeze()get(int pIndex) get(ResourceLocation pKey) getAny()intgetOptional(ResourceKey<T> pRegistryKey) getOptional(ResourceLocation pName) getRandom(RandomSource pRandom) getRandomElementOf(TagKey<T> pKey, RandomSource pRandom) getResourceKey(T pValue) getTagOrEmpty(TagKey<T> pKey) getTags()getValue(ResourceKey<T> pKey) getValue(ResourceLocation pKey) default TgetValueOrThrow(ResourceKey<T> pKey) ResourceKey<? extends Registry<T>> key()default <U> Stream<U> keys(com.mojang.serialization.DynamicOps<U> pOps) keySet()prepareTagReload(TagLoader.LoadResult<T> pLoadResult) private com.mojang.serialization.Codec<Holder.Reference<T>> static <T> Tstatic <V,T extends V>
Tregister(Registry<V> pRegistry, ResourceKey<V> pKey, T pValue) static <V,T extends V>
Tregister(Registry<V> pRegistry, ResourceLocation pName, T pValue) static <T> Holder.Reference<T> registerForHolder(Registry<T> pRegistry, ResourceKey<T> pKey, T pValue) static <T> Holder.Reference<T> registerForHolder(Registry<T> pRegistry, ResourceLocation pName, T pValue) registrationInfo(ResourceKey<T> pKey) Set<ResourceKey<T>> private com.mojang.serialization.DataResult<Holder.Reference<T>> safeCastToReference(Holder<T> p_326365_) stream()wrapAsHolder(T pValue) Methods inherited from interface net.minecraft.core.HolderGetter
get, get, getOrThrow, getOrThrowMethods inherited from interface net.minecraft.core.HolderLookup
listElementIds, listElements, listTagIds, listTagsMethods inherited from interface net.minecraft.core.HolderLookup.RegistryLookup
filterElements, filterFeatures, getData, registryLifecycleMethods inherited from interface net.minecraft.core.HolderOwner
canSerializeInMethods inherited from interface net.minecraft.core.IdMap
byId, byIdOrThrow, getIdOrThrow, sizeMethods inherited from interface net.neoforged.neoforge.registries.IRegistryExtension
addAlias, addCallback, addCallback, containsValue, doesSync, getDataMap, getId, getId, getKeyOrNull, getMaxId, resolve, resolveMethods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
key
ResourceKey<? extends Registry<T>> key()- Specified by:
keyin interfaceHolderLookup.RegistryLookup<T>
-
byNameCodec
-
holderByNameCodec
-
referenceHolderWithLifecycle
-
safeCastToReference
private com.mojang.serialization.DataResult<Holder.Reference<T>> safeCastToReference(Holder<T> p_326365_) -
keys
- Specified by:
keysin interfacecom.mojang.serialization.Keyable
-
getKey
- Returns:
- the name used to identify the given object within this registry or
nullif the object is not within this registry
-
getResourceKey
-
getId
-
getValue
-
getValue
-
registrationInfo
-
getOptional
-
getOptional
-
getAny
Optional<Holder.Reference<T>> getAny() -
getValueOrThrow
-
keySet
Set<ResourceLocation> keySet() -
entrySet
Set<Map.Entry<ResourceKey<T>,T>> entrySet() -
registryKeySet
Set<ResourceKey<T>> registryKeySet() -
getRandom
-
stream
-
containsKey
-
containsKey
-
register
-
register
-
register
-
registerForHolder
static <T> Holder.Reference<T> registerForHolder(Registry<T> pRegistry, ResourceKey<T> pKey, T pValue) -
registerForHolder
static <T> Holder.Reference<T> registerForHolder(Registry<T> pRegistry, ResourceLocation pName, T pValue) -
freeze
-
createIntrusiveHolder
-
get
-
get
-
wrapAsHolder
-
getTagOrEmpty
-
getRandomElementOf
-
getTags
Stream<HolderSet.Named<T>> getTags() -
asHolderIdMap
-
prepareTagReload
-