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(Identifier name) booleancontainsKey(ResourceKey<T> key) createIntrusiveHolder(T value) Set<Map.Entry<ResourceKey<T>, T>> entrySet()freeze()get(int index) get(Identifier key) getAny()int@Nullable IdentifiergetOptional(@Nullable Identifier key) getOptional(@Nullable ResourceKey<T> registryKey) getRandom(RandomSource random) getResourceKey(T value) getTagOrEmpty(TagKey<T> key) getTags()@Nullable TgetValue(@Nullable Identifier key) @Nullable TgetValue(@Nullable ResourceKey<T> 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, Identifier name, T value) static <V,T extends V>
Tregister(Registry<V> registry, ResourceKey<V> key, T value) static <R,T extends R>
Holder.Reference<T> registerForHolder(Registry<R> registry, Identifier key, T value) static <R,T extends R>
Holder.Reference<T> registerForHolder(Registry<R> registry, ResourceKey<R> key, 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, getOrThrow, getRandomElementOfMethods 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<Identifier> keySet() -
entrySet
Set<Map.Entry<ResourceKey<T>,T>> entrySet() -
registryKeySet
Set<ResourceKey<T>> registryKeySet() -
getRandom
-
stream
-
containsKey
-
containsKey
-
register
-
register
-
register
-
registerForHolder
static <R,T extends R> Holder.Reference<T> registerForHolder(Registry<R> registry, ResourceKey<R> key, T value) -
registerForHolder
static <R,T extends R> Holder.Reference<T> registerForHolder(Registry<R> registry, Identifier key, T value) -
freeze
-
createIntrusiveHolder
-
get
-
get
-
wrapAsHolder
-
getTagOrEmpty
-
getTags
Stream<HolderSet.Named<T>> getTags() -
asHolderIdMap
-
prepareTagReload
-