Package net.minecraft.core
Class MappedRegistry<T>
java.lang.Object
net.minecraft.core.Registry<T>
net.minecraft.core.WritableRegistry<T>
net.minecraft.core.MappedRegistry<T>
- Direct Known Subclasses:
DefaultedRegistry
,NamespacedWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.core.Registry
Registry.RegistryBootstrap<T>
-
Field Summary
Modifier 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 final Function<T,
Holder.Reference<T>> private com.mojang.serialization.Lifecycle
private boolean
private List<Holder.Reference<T>>
private Map<T,
Holder.Reference<T>> private static final Set<ResourceLocation>
private static final org.slf4j.Logger
private int
private Map<TagKey<T>,
HolderSet.Named<T>> private final it.unimi.dsi.fastutil.objects.Object2IntMap<T>
Fields inherited from class net.minecraft.core.Registry
ACTIVITY, ACTIVITY_REGISTRY, ATTRIBUTE, ATTRIBUTE_REGISTRY, BANNER_PATTERN, BANNER_PATTERN_REGISTRY, BIOME_REGISTRY, BIOME_SOURCE, BIOME_SOURCE_REGISTRY, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_ENTITY_TYPE_REGISTRY, BLOCK_PREDICATE_TYPE_REGISTRY, BLOCK_PREDICATE_TYPES, BLOCK_REGISTRY, BLOCK_STATE_PROVIDER_TYPE_REGISTRY, BLOCKSTATE_PROVIDER_TYPES, CARVER, CARVER_REGISTRY, CAT_VARIANT, CAT_VARIANT_REGISTRY, CHAT_TYPE_REGISTRY, CHUNK_GENERATOR, CHUNK_GENERATOR_REGISTRY, CHUNK_STATUS, CHUNK_STATUS_REGISTRY, COMMAND_ARGUMENT_TYPE, COMMAND_ARGUMENT_TYPE_REGISTRY, CONDITION, CONDITION_REGISTRY, CONFIGURED_CARVER_REGISTRY, CONFIGURED_FEATURE_REGISTRY, CUSTOM_STAT, CUSTOM_STAT_REGISTRY, DENSITY_FUNCTION_REGISTRY, DENSITY_FUNCTION_TYPE_REGISTRY, DENSITY_FUNCTION_TYPES, DIMENSION_REGISTRY, DIMENSION_TYPE_REGISTRY, ENCHANTMENT, ENCHANTMENT_REGISTRY, ENTITY_TYPE, ENTITY_TYPE_REGISTRY, FEATURE, FEATURE_REGISTRY, FEATURE_SIZE_TYPE_REGISTRY, FEATURE_SIZE_TYPES, FLAT_LEVEL_GENERATOR_PRESET_REGISTRY, FLOAT_PROVIDER_TYPE_REGISTRY, FLOAT_PROVIDER_TYPES, FLUID, FLUID_REGISTRY, FOLIAGE_PLACER_TYPE_REGISTRY, FOLIAGE_PLACER_TYPES, FROG_VARIANT, FROG_VARIANT_REGISTRY, GAME_EVENT, GAME_EVENT_REGISTRY, HEIGHT_PROVIDER_TYPE_REGISTRY, HEIGHT_PROVIDER_TYPES, INSTRUMENT, INSTRUMENT_REGISTRY, INT_PROVIDER_TYPE_REGISTRY, INT_PROVIDER_TYPES, ITEM, ITEM_REGISTRY, LEVEL_STEM_REGISTRY, LOOT_CONDITION_TYPE, LOOT_ENTRY_REGISTRY, LOOT_FUNCTION_REGISTRY, LOOT_FUNCTION_TYPE, LOOT_ITEM_REGISTRY, LOOT_NBT_PROVIDER_REGISTRY, LOOT_NBT_PROVIDER_TYPE, LOOT_NUMBER_PROVIDER_REGISTRY, LOOT_NUMBER_PROVIDER_TYPE, LOOT_POOL_ENTRY_TYPE, LOOT_SCORE_PROVIDER_REGISTRY, LOOT_SCORE_PROVIDER_TYPE, MEMORY_MODULE_TYPE, MEMORY_MODULE_TYPE_REGISTRY, MENU, MENU_REGISTRY, MOB_EFFECT, MOB_EFFECT_REGISTRY, NOISE_GENERATOR_SETTINGS_REGISTRY, NOISE_REGISTRY, PAINTING_VARIANT, PAINTING_VARIANT_REGISTRY, PARTICLE_TYPE, PARTICLE_TYPE_REGISTRY, PLACED_FEATURE_REGISTRY, PLACEMENT_MODIFIER_REGISTRY, PLACEMENT_MODIFIERS, POINT_OF_INTEREST_TYPE, POINT_OF_INTEREST_TYPE_REGISTRY, POS_RULE_TEST, POS_RULE_TEST_REGISTRY, POSITION_SOURCE_TYPE, POSITION_SOURCE_TYPE_REGISTRY, POTION, POTION_REGISTRY, PROCESSOR_LIST_REGISTRY, RECIPE_SERIALIZER, RECIPE_SERIALIZER_REGISTRY, RECIPE_TYPE, RECIPE_TYPE_REGISTRY, REGISTRY, ROOT_PLACER_TYPE_REGISTRY, ROOT_PLACER_TYPES, ROOT_REGISTRY_NAME, RULE, RULE_REGISTRY, RULE_TEST, RULE_TEST_REGISTRY, SCHEDULE, SCHEDULE_REGISTRY, SENSOR_TYPE, SENSOR_TYPE_REGISTRY, SOUND_EVENT, SOUND_EVENT_REGISTRY, STAT_TYPE, STAT_TYPE_REGISTRY, STRUCTURE_PIECE, STRUCTURE_PIECE_REGISTRY, STRUCTURE_PLACEMENT_TYPE, STRUCTURE_PLACEMENT_TYPE_REGISTRY, STRUCTURE_POOL_ELEMENT, STRUCTURE_POOL_ELEMENT_REGISTRY, STRUCTURE_PROCESSOR, STRUCTURE_PROCESSOR_REGISTRY, STRUCTURE_REGISTRY, STRUCTURE_SET_REGISTRY, STRUCTURE_TYPE_REGISTRY, STRUCTURE_TYPES, TEMPLATE_POOL_REGISTRY, TREE_DECORATOR_TYPE_REGISTRY, TREE_DECORATOR_TYPES, TRUNK_PLACER_TYPE_REGISTRY, TRUNK_PLACER_TYPES, VILLAGER_PROFESSION, VILLAGER_PROFESSION_REGISTRY, VILLAGER_TYPE, VILLAGER_TYPE_REGISTRY, WORLD_PRESET_REGISTRY, WRITABLE_REGISTRY
-
Constructor Summary
ConstructorDescriptionMappedRegistry
(ResourceKey<? extends Registry<T>> p_205849_, com.mojang.serialization.Lifecycle p_205850_, Function<T, Holder.Reference<T>> p_205851_) -
Method Summary
Modifier and TypeMethodDescriptionvoid
byId
(int p_122684_) boolean
containsKey
(ResourceKey<T> p_175392_) boolean
containsKey
(ResourceLocation p_122761_) createIntrusiveHolder
(T p_205915_) private HolderSet.Named<T>
com.mojang.serialization.Lifecycle
Set<Map.Entry<ResourceKey<T>,
T>> entrySet()
freeze()
get
(ResourceKey<T> p_122714_) get
(ResourceLocation p_122739_) getHolder
(int p_205907_) getHolder
(ResourceKey<T> p_205905_) int
static Set<ResourceLocation>
getOrCreateHolder
(ResourceKey<T> p_235720_) getOrCreateHolderOrThrow
(ResourceKey<T> p_235718_) 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> T
getValueFromNullable
(Holder.Reference<T> p_205866_) holders()
private List<Holder.Reference<T>>
boolean
isEmpty()
boolean
isKnownTagName
(TagKey<T> p_205864_) iterator()
keySet()
com.mojang.serialization.Lifecycle
protected final void
register
(ResourceKey<T> p_205891_, T p_205892_, com.mojang.serialization.Lifecycle p_205893_) registerMapping
(int p_205853_, ResourceKey<T> p_205854_, T p_205855_, com.mojang.serialization.Lifecycle p_205856_) registerMapping
(int p_205858_, ResourceKey<T> p_205859_, T p_205860_, com.mojang.serialization.Lifecycle p_205861_, boolean p_205862_) registerOrOverride
(OptionalInt p_205884_, ResourceKey<T> p_205885_, T p_205886_, com.mojang.serialization.Lifecycle p_205887_) Set<ResourceKey<T>>
void
int
size()
void
unfreeze()
Deprecated.Forge: For internal use only.private void
validateWrite
(ResourceKey<T> p_205922_) Methods inherited from class net.minecraft.core.Registry
asHolderIdMap, byNameCodec, checkRegistry, freezeBuiltins, getHolderOrThrow, getOptional, getOptional, getOrThrow, getTagOrEmpty, holderByNameCodec, key, keys, lifecycle, register, register, register, registerMapping, stream, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.minecraft.core.IdMap
byIdOrThrow
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
LOGGER
private static final org.slf4j.Logger LOGGER -
byId
-
toId
-
byLocation
-
byKey
-
byValue
-
lifecycles
-
elementsLifecycle
private com.mojang.serialization.Lifecycle elementsLifecycle -
tags
-
frozen
private boolean frozen -
customHolderProvider
-
intrusiveHolderCache
-
holdersInOrder
-
nextId
private int nextId -
KNOWN
-
-
Constructor Details
-
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> p_205849_, com.mojang.serialization.Lifecycle p_205850_, @Nullable Function<T, Holder.Reference<T>> p_205851_)
-
-
Method Details
-
holdersInOrder
-
validateWrite
-
registerMapping
public Holder<T> registerMapping(int p_205853_, ResourceKey<T> p_205854_, T p_205855_, com.mojang.serialization.Lifecycle p_205856_) - Specified by:
registerMapping
in classWritableRegistry<T>
-
getKnownRegistries
-
markKnown
protected final void markKnown() -
registerMapping
private Holder<T> registerMapping(int p_205858_, ResourceKey<T> p_205859_, T p_205860_, com.mojang.serialization.Lifecycle p_205861_, boolean p_205862_) -
register
public Holder<T> register(ResourceKey<T> p_205891_, T p_205892_, com.mojang.serialization.Lifecycle p_205893_) - Specified by:
register
in classWritableRegistry<T>
-
registerOrOverride
public Holder<T> registerOrOverride(OptionalInt p_205884_, ResourceKey<T> p_205885_, T p_205886_, com.mojang.serialization.Lifecycle p_205887_) - Specified by:
registerOrOverride
in classWritableRegistry<T>
-
getKey
-
getResourceKey
- Specified by:
getResourceKey
in classRegistry<T>
-
getId
-
get
-
byId
-
getHolder
-
getHolder
-
getOrCreateHolderOrThrow
- Specified by:
getOrCreateHolderOrThrow
in classRegistry<T>
-
getOrCreateHolder
- Specified by:
getOrCreateHolder
in classRegistry<T>
-
size
public int size() -
lifecycle
-
elementsLifecycle
public com.mojang.serialization.Lifecycle elementsLifecycle()- Specified by:
elementsLifecycle
in classRegistry<T>
-
iterator
-
get
-
getValueFromNullable
-
keySet
-
registryKeySet
- Specified by:
registryKeySet
in classRegistry<T>
-
entrySet
-
holders
-
isKnownTagName
- Specified by:
isKnownTagName
in classRegistry<T>
-
getTags
-
getOrCreateTag
- Specified by:
getOrCreateTag
in classRegistry<T>
-
createTag
-
getTagNames
- Specified by:
getTagNames
in classRegistry<T>
-
isEmpty
public boolean isEmpty()- Specified by:
isEmpty
in classWritableRegistry<T>
-
getRandom
-
containsKey
- Specified by:
containsKey
in classRegistry<T>
-
containsKey
- Specified by:
containsKey
in classRegistry<T>
-
unfreeze
Deprecated.Forge: For internal use only. Use the Register events when registering values. -
freeze
-
createIntrusiveHolder
- Specified by:
createIntrusiveHolder
in classRegistry<T>
-
getTag
-
bindTags
-
resetTags
public void resetTags()
-