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> key) booleancontainsKey(ResourceLocation name) createIntrusiveHolder(T value) Set<Map.Entry<ResourceKey<T>, T>> entrySet()freeze()get(int index) get(ResourceLocation key) getAny()intgetOptional(ResourceKey<T> registryKey) getOptional(ResourceLocation name) getRandom(RandomSource random) getRandomElementOf(TagKey<T> key, RandomSource random) getResourceKey(T value) getTagOrEmpty(TagKey<T> key) getTags()getValue(ResourceKey<T> key) getValue(ResourceLocation key) default TgetValueOrThrow(ResourceKey<T> key) ResourceKey<? extends Registry<T>> key()default <U> Stream<U> keys(com.mojang.serialization.DynamicOps<U> ops) keySet()prepareTagReload(TagLoader.LoadResult<T> loadResult) private com.mojang.serialization.Codec<Holder.Reference<T>> static <T> Tstatic <V,T extends V>
Tregister(Registry<V> registry, ResourceKey<V> key, T value) static <V,T extends V>
Tregister(Registry<V> registry, ResourceLocation name, T value) static <T> Holder.Reference<T> registerForHolder(Registry<T> registry, ResourceKey<T> key, T value) static <T> Holder.Reference<T> registerForHolder(Registry<T> registry, ResourceLocation name, T value) registrationInfo(ResourceKey<T> key) Set<ResourceKey<T>> private com.mojang.serialization.DataResult<Holder.Reference<T>> safeCastToReference(Holder<T> value) stream()wrapAsHolder(T value) 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> value) -
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
-
registerForHolder
static <T> Holder.Reference<T> registerForHolder(Registry<T> registry, ResourceLocation name, T value) -
freeze
-
createIntrusiveHolder
-
get
-
get
-
wrapAsHolder
-
getTagOrEmpty
-
getRandomElementOf
-
getTags
Stream<HolderSet.Named<T>> getTags() -
asHolderIdMap
-
prepareTagReload
-