Package net.minecraft.core
Class MappedRegistry<T>
java.lang.Object
net.minecraft.core.MappedRegistry<T>
- All Implemented Interfaces:
com.mojang.serialization.Keyable,Iterable<T>,IdMap<T>,Registry<T>,WritableRegistry<T>
- Direct Known Subclasses:
DefaultedMappedRegistry,NamespacedWrapper
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final it.unimi.dsi.fastutil.objects.ObjectList<Holder.Reference<T>> private final Map<ResourceKey<T>, Holder.Reference<T>> private final Map<ResourceLocation, Holder.Reference<T>> private final Map<T, Holder.Reference<T>> private boolean(package private) final ResourceKey<? extends Registry<T>> private static final Set<ResourceLocation> private static final org.slf4j.Loggerprivate final HolderLookup.RegistryLookup<T> private final Map<ResourceKey<T>, RegistrationInfo> private com.mojang.serialization.Lifecycleprivate final Objectprivate Map<TagKey<T>, HolderSet.Named<T>> private final it.unimi.dsi.fastutil.objects.Reference2IntMap<T> protected Map<T, Holder.Reference<T>> -
Constructor Summary
ConstructorsConstructorDescriptionMappedRegistry(ResourceKey<? extends Registry<T>> p_249899_, com.mojang.serialization.Lifecycle p_252249_) MappedRegistry(ResourceKey<? extends Registry<T>> p_252132_, com.mojang.serialization.Lifecycle p_249215_, boolean p_251014_) -
Method Summary
Modifier and TypeMethodDescriptionasLookup()voidbyId(int p_122684_) booleancontainsKey(ResourceKey<T> p_175392_) booleancontainsKey(ResourceLocation p_122761_) createIntrusiveHolder(T p_205915_) private HolderSet.Named<T> Set<Map.Entry<ResourceKey<T>, T>> entrySet()freeze()get(ResourceKey<T> p_122714_) get(ResourceLocation p_122739_) getAny()getHolder(int p_205907_) getHolder(ResourceKey<T> p_205905_) getHolder(ResourceLocation p_333710_) intstatic Set<ResourceLocation> protected Holder.Reference<T> getOrCreateHolderOrThrow(ResourceKey<T> p_248831_) getOrCreateTag(TagKey<T> p_205895_) getRandom(RandomSource p_235716_) getResourceKey(T p_122755_) Stream<com.mojang.datafixers.util.Pair<TagKey<T>, HolderSet.Named<T>>> getTags()private static <T> TgetValueFromNullable(Holder.Reference<T> p_205866_) holders()booleanisEmpty()booleaniterator()ResourceKey<? extends Registry<T>> key()keySet()protected final voidregister(ResourceKey<T> p_256252_, T p_256591_, RegistrationInfo p_329661_) registrationInfo(ResourceKey<T> p_331530_) Set<ResourceKey<T>> com.mojang.serialization.Lifecyclevoidintsize()toString()voidunfreeze()Deprecated.Forge: For internal use only.private voidprivate voidvalidateWrite(ResourceKey<T> p_205922_) wrapAsHolder(T p_263356_) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface net.minecraft.core.IdMap
byIdOrThrow, getIdOrThrowMethods inherited from interface java.lang.Iterable
forEach, spliteratorMethods inherited from interface net.minecraft.core.Registry
asHolderIdMap, asTagAddingLookup, byNameCodec, getHolderOrThrow, getOptional, getOptional, getOrThrow, getRandomElementOf, getTagOrEmpty, holderByNameCodec, keys, stream
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
key
-
byId
-
toId
-
byLocation
-
byKey
-
byValue
-
registrationInfos
-
registryLifecycle
private com.mojang.serialization.Lifecycle registryLifecycle -
tags
-
frozen
private boolean frozen -
unregisteredIntrusiveHolders
-
lookup
-
tagAdditionLock
-
KNOWN
-
-
Constructor Details
-
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> p_249899_, com.mojang.serialization.Lifecycle p_252249_) -
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> p_252132_, com.mojang.serialization.Lifecycle p_249215_, boolean p_251014_)
-
-
Method Details
-
key
-
toString
-
validateWrite
private void validateWrite() -
validateWrite
-
register
public Holder.Reference<T> register(ResourceKey<T> p_256252_, T p_256591_, RegistrationInfo p_329661_) - Specified by:
registerin interfaceWritableRegistry<T>
-
getKey
-
getResourceKey
- Specified by:
getResourceKeyin interfaceRegistry<T>
-
getId
-
get
-
byId
-
getHolder
-
getHolder
-
getHolder
-
getAny
-
wrapAsHolder
- Specified by:
wrapAsHolderin interfaceRegistry<T>
-
getOrCreateHolderOrThrow
-
size
public int size() -
registrationInfo
- Specified by:
registrationInfoin interfaceRegistry<T>
-
registryLifecycle
public com.mojang.serialization.Lifecycle registryLifecycle()- Specified by:
registryLifecyclein interfaceRegistry<T>
-
iterator
-
get
-
getValueFromNullable
-
keySet
-
registryKeySet
- Specified by:
registryKeySetin interfaceRegistry<T>
-
entrySet
-
holders
-
getTags
-
getOrCreateTag
- Specified by:
getOrCreateTagin interfaceRegistry<T>
-
createTag
-
getTagNames
- Specified by:
getTagNamesin interfaceRegistry<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmptyin interfaceWritableRegistry<T>
-
getRandom
-
containsKey
- Specified by:
containsKeyin interfaceRegistry<T>
-
containsKey
- Specified by:
containsKeyin interfaceRegistry<T>
-
freeze
-
createIntrusiveHolder
- Specified by:
createIntrusiveHolderin interfaceRegistry<T>
-
getTag
-
bindTags
-
resetTags
public void resetTags() -
createRegistrationLookup
- Specified by:
createRegistrationLookupin interfaceWritableRegistry<T>
-
holderOwner
- Specified by:
holderOwnerin interfaceRegistry<T>
-
asLookup
-
isIntrusive
public boolean isIntrusive() -
getKnownRegistries
-
markKnown
protected final void markKnown() -
unfreeze
Deprecated.Forge: For internal use only. Use the Register events when registering values.
-