Package net.minecraft.core
Interface Registry<T>
- All Superinterfaces:
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, IdMap<T>, IRegistryExtension<T>
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionasLookup()
default HolderLookup.RegistryLookup
<T> void
default com.mojang.serialization.Codec
<T> boolean
containsKey
(ResourceKey<T> p_175475_) boolean
containsKey
(ResourceLocation p_123011_) createIntrusiveHolder
(T p_206068_) Set
<Map.Entry<ResourceKey<T>, T>> entrySet()
freeze()
get
(ResourceKey<T> p_122980_) get
(ResourceLocation p_123002_) getHolder
(int p_206051_) getHolder
(ResourceKey<T> p_206050_) getHolder
(ResourceLocation p_316492_) default Holder.Reference
<T> getHolderOrThrow
(ResourceKey<T> p_249087_) int
getOptional
(ResourceKey<T> p_123010_) getOptional
(ResourceLocation p_123007_) getOrCreateTag
(TagKey<T> p_206045_) default T
getOrThrow
(ResourceKey<T> p_123014_) getRandom
(RandomSource p_235781_) getRandomElementOf
(TagKey<T> p_320357_, RandomSource p_320935_) getResourceKey
(T p_123008_) getTagOrEmpty
(TagKey<T> p_206059_) Stream
<com.mojang.datafixers.util.Pair<TagKey<T>, HolderSet.Named<T>>> getTags()
holders()
ResourceKey
<? extends Registry<T>> key()
default <U> Stream
<U> keys
(com.mojang.serialization.DynamicOps<U> p_123030_) keySet()
private com.mojang.serialization.Codec
<Holder.Reference<T>> static <T> T
static <V,
T extends V>
Tregister
(Registry<V> p_194580_, ResourceKey<V> p_194581_, T p_194582_) static <V,
T extends V>
Tregister
(Registry<V> p_122966_, ResourceLocation p_122967_, T p_122968_) static <T> Holder.Reference
<T> registerForHolder
(Registry<T> p_263347_, ResourceKey<T> p_263355_, T p_263428_) static <T> Holder.Reference
<T> registerForHolder
(Registry<T> p_263351_, ResourceLocation p_263363_, T p_263423_) registrationInfo
(ResourceKey<T> p_326162_) Set
<ResourceKey<T>> com.mojang.serialization.Lifecycle
void
private com.mojang.serialization.DataResult
<Holder.Reference<T>> safeCastToReference
(Holder<T> p_326365_) stream()
wrapAsHolder
(T p_263382_) Methods inherited from interface net.minecraft.core.IdMap
byId, byIdOrThrow, getIdOrThrow, size
Methods inherited from interface net.neoforged.neoforge.registries.IRegistryExtension
addAlias, addCallback, addCallback, containsValue, doesSync, getData, getDataMap, getId, getId, getMaxId, resolve, resolve
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
key
ResourceKey<? extends Registry<T>> key() -
byNameCodec
-
holderByNameCodec
-
referenceHolderWithLifecycle
-
safeCastToReference
private com.mojang.serialization.DataResult<Holder.Reference<T>> safeCastToReference(Holder<T> p_326365_) -
keys
- Specified by:
keys
in interfacecom.mojang.serialization.Keyable
-
getKey
-
getResourceKey
-
getId
-
get
-
get
-
registrationInfo
-
registryLifecycle
com.mojang.serialization.Lifecycle registryLifecycle() -
getOptional
-
getOptional
-
getOrThrow
-
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> p_263347_, ResourceKey<T> p_263355_, T p_263428_) -
registerForHolder
static <T> Holder.Reference<T> registerForHolder(Registry<T> p_263351_, ResourceLocation p_263363_, T p_263423_) -
freeze
-
createIntrusiveHolder
-
getHolder
-
getHolder
-
getHolder
-
wrapAsHolder
-
getHolderOrThrow
-
holders
Stream<Holder.Reference<T>> holders() -
getTag
-
getTagOrEmpty
-
getRandomElementOf
-
getOrCreateTag
-
getTags
Stream<com.mojang.datafixers.util.Pair<TagKey<T>,HolderSet.Named<T>>> getTags() -
getTagNames
-
resetTags
void resetTags() -
bindTags
-
asHolderIdMap
-
holderOwner
HolderOwner<T> holderOwner() -
asLookup
HolderLookup.RegistryLookup<T> asLookup() -
asTagAddingLookup
-