Interface Registry<T>
- All Superinterfaces:
HolderGetter<T>, HolderLookup<T>, HolderLookup.RegistryLookup<T>, HolderOwner<T>, IdMap<T>, IRegistryExtension<T>, Iterable<T>, Keyable
- All Known Subinterfaces:
DefaultedRegistry<T>, WritableRegistry<T>
- All Known Implementing Classes:
BaseMappedRegistry, DefaultedMappedRegistry, MappedRegistry
public interface Registry<T>
extends IdMap<T>, Keyable, HolderLookup.RegistryLookup<T>, IRegistryExtension<T>
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from interface HolderLookup
HolderLookup.Provider, HolderLookup.RegistryLookup<T>Nested classes/interfaces inherited from interface HolderLookup.RegistryLookup
HolderLookup.RegistryLookup.Delegate<T> -
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionbooleancontainsKey(Identifier key) booleancontainsKey(ResourceKey<T> key) createIntrusiveHolder(T value) Set<Map.Entry<ResourceKey<T>, T>> entrySet()freeze()get(int id) get(Identifier id) getAny()int@Nullable IdentifiergetOptional(@Nullable Identifier key) getOptional(@Nullable ResourceKey<T> key) getRandom(RandomSource random) getResourceKey(T thing) getTagOrEmpty(TagKey<T> id) 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(DynamicOps<U> ops) keySet()private Codec<Holder.Reference<T>> static <T> Tstatic <V, T extends V>
Tregister(Registry<V> registry, Identifier location, 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 location, T value) static <R, T extends R>
Holder.Reference<T> registerForHolder(Registry<R> registry, ResourceKey<R> key, T value) registrationInfo(ResourceKey<T> element) Set<ResourceKey<T>> private DataResult<Holder.Reference<T>> safeCastToReference(Holder<T> holder) stream()wrapAsHolder(T value) Methods 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
byId, byIdOrThrow, getIdOrThrow, sizeMethods inherited from interface IRegistryExtension
addAlias, addCallback, addCallback, containsValue, doesSync, getDataMap, getId, getId, getKeyOrNull, getMaxId, resolve, resolveMethods inherited from interface Iterable
forEach, iterator, spliterator
-
Method Details
-
key
ResourceKey<? extends Registry<T>> key()- Specified by:
keyin interfaceHolderLookup.RegistryLookup<T>
-
byNameCodec
-
holderByNameCodec
-
referenceHolderWithLifecycle
-
safeCastToReference
-
keys
-
getKey
-
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 location, T value) -
freeze
-
createIntrusiveHolder
-
get
-
get
-
wrapAsHolder
-
getTagOrEmpty
-
getTags
Stream<HolderSet.Named<T>> getTags() -
asHolderIdMap
-
prepareTagReload
-
componentLookup
DataComponentLookup<T> componentLookup()
-