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>
- All Implemented Interfaces:
com.mojang.serialization.Codec<T>
,com.mojang.serialization.Decoder<T>
,com.mojang.serialization.Encoder<T>
,com.mojang.serialization.Keyable
,Iterable<T>
,IdMap<T>
- Direct Known Subclasses:
DefaultedRegistry
,NamespacedWrapper
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.mojang.serialization.Codec
com.mojang.serialization.Codec.ResultFunction<A extends Object>
-
Field Summary
Modifier and TypeFieldDescriptionprivate it.unimi.dsi.fastutil.objects.ObjectList<T>
private com.mojang.serialization.Lifecycle
private com.google.common.collect.BiMap<ResourceKey<T>,T>
protected static org.apache.logging.log4j.Logger
private int
protected Object[]
private com.google.common.collect.BiMap<ResourceLocation,T>
private it.unimi.dsi.fastutil.objects.Object2IntMap<T>
Fields inherited from class net.minecraft.core.Registry
ACTIVITY, ACTIVITY_REGISTRY, ATTRIBUTE, ATTRIBUTE_REGISTRY, BIOME_REGISTRY, BIOME_SOURCE, BIOME_SOURCE_REGISTRY, BLOCK, BLOCK_ENTITY_TYPE, BLOCK_ENTITY_TYPE_REGISTRY, BLOCK_PLACER_TYPE_REGISTRY, BLOCK_PLACER_TYPES, BLOCK_REGISTRY, BLOCK_STATE_PROVIDER_TYPE_REGISTRY, BLOCKSTATE_PROVIDER_TYPES, CARVER, CARVER_REGISTRY, CHUNK_GENERATOR, CHUNK_GENERATOR_REGISTRY, CHUNK_STATUS, CHUNK_STATUS_REGISTRY, CONFIGURED_CARVER_REGISTRY, CONFIGURED_FEATURE_REGISTRY, CONFIGURED_STRUCTURE_FEATURE_REGISTRY, CONFIGURED_SURFACE_BUILDER_REGISTRY, CUSTOM_STAT, CUSTOM_STAT_REGISTRY, DECORATOR, DECORATOR_REGISTRY, DIMENSION_REGISTRY, DIMENSION_TYPE_REGISTRY, ENCHANTMENT, ENCHANTMENT_REGISTRY, ENTITY_TYPE, ENTITY_TYPE_REGISTRY, FEATURE, FEATURE_REGISTRY, FEATURE_SIZE_TYPE_REGISTRY, FEATURE_SIZE_TYPES, FLOAT_PROVIDER_TYPE_REGISTRY, FLOAT_PROVIDER_TYPES, FLUID, FLUID_REGISTRY, FOLIAGE_PLACER_TYPE_REGISTRY, FOLIAGE_PLACER_TYPES, GAME_EVENT, GAME_EVENT_REGISTRY, HEIGHT_PROVIDER_TYPE_REGISTRY, HEIGHT_PROVIDER_TYPES, 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, MOTIVE, MOTIVE_REGISTRY, NOISE_GENERATOR_SETTINGS_REGISTRY, PARTICLE_TYPE, PARTICLE_TYPE_REGISTRY, 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_REGISTRY_NAME, RULE_TEST, RULE_TEST_REGISTRY, SCHEDULE, SCHEDULE_REGISTRY, SENSOR_TYPE, SENSOR_TYPE_REGISTRY, SOUND_EVENT, SOUND_EVENT_REGISTRY, STAT_TYPE, STAT_TYPE_REGISTRY, STRUCTURE_FEATURE, STRUCTURE_FEATURE_REGISTRY, STRUCTURE_PIECE, STRUCTURE_PIECE_REGISTRY, STRUCTURE_POOL_ELEMENT, STRUCTURE_POOL_ELEMENT_REGISTRY, STRUCTURE_PROCESSOR, STRUCTURE_PROCESSOR_REGISTRY, SURFACE_BUILDER, SURFACE_BUILDER_REGISTRY, 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, WRITABLE_REGISTRY
Fields inherited from interface com.mojang.serialization.Codec
BOOL, BYTE, BYTE_BUFFER, DOUBLE, EMPTY, FLOAT, INT, INT_STREAM, LONG, LONG_STREAM, PASSTHROUGH, SHORT, STRING
-
Constructor Summary
ConstructorDescriptionMappedRegistry(ResourceKey<? extends Registry<T>> p_122681_, com.mojang.serialization.Lifecycle p_122682_)
-
Method Summary
Modifier and TypeMethodDescriptionbyId(int p_122684_)
boolean
containsKey(ResourceKey<T> p_175392_)
boolean
containsKey(ResourceLocation p_122761_)
static <T> com.mojang.serialization.Codec<MappedRegistry<T>>
dataPackCodec(ResourceKey<? extends Registry<T>> p_122748_, com.mojang.serialization.Lifecycle p_122749_, com.mojang.serialization.Codec<T> p_122750_)
static <T> com.mojang.serialization.Codec<MappedRegistry<T>>
directCodec(ResourceKey<? extends Registry<T>> p_122757_, com.mojang.serialization.Lifecycle p_122758_, com.mojang.serialization.Codec<T> p_122759_)
com.mojang.serialization.Lifecycle
Set<Map.Entry<ResourceKey<T>,T>>
entrySet()
get(ResourceKey<T> p_122714_)
get(ResourceLocation p_122739_)
int
getResourceKey(T p_122755_)
boolean
isEmpty()
iterator()
keySet()
com.mojang.serialization.Lifecycle
static <T> com.mojang.serialization.Codec<MappedRegistry<T>>
networkCodec(ResourceKey<? extends Registry<T>> p_122716_, com.mojang.serialization.Lifecycle p_122717_, com.mojang.serialization.Codec<T> p_122718_)
<V extends T>
Vregister(ResourceKey<T> p_122735_, V p_122736_, com.mojang.serialization.Lifecycle p_122737_)
<V extends T>
VregisterMapping(int p_122686_, ResourceKey<T> p_122687_, V p_122688_, com.mojang.serialization.Lifecycle p_122689_)
private <V extends T>
VregisterMapping(int p_122691_, ResourceKey<T> p_122692_, V p_122693_, com.mojang.serialization.Lifecycle p_122694_, boolean p_122695_)
<V extends T>
VregisterOrOverride(OptionalInt p_122708_, ResourceKey<T> p_122709_, V p_122710_, com.mojang.serialization.Lifecycle p_122711_)
static <T> com.mojang.serialization.MapCodec<MappedRegistry.RegistryEntry<T>>
withNameAndId(ResourceKey<? extends Registry<T>> p_122728_, com.mojang.serialization.MapCodec<T> p_122729_)
Methods inherited from class net.minecraft.core.Registry
checkRegistry, decode, encode, getOptional, getOptional, getOrThrow, key, keys, 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 com.mojang.serialization.Codec
comapFlatMap, deprecated, dispatch, dispatch, dispatchMap, dispatchMap, dispatchStable, fieldOf, flatComapMap, flatXmap, listOf, mapResult, optionalFieldOf, optionalFieldOf, optionalFieldOf, optionalFieldOf, orElse, orElse, orElse, orElseGet, orElseGet, orElseGet, partialDispatch, promotePartial, stable, withLifecycle, xmap
Methods inherited from interface com.mojang.serialization.Decoder
boxed, decode, flatMap, map, parse, parse, simple, terminal
Methods inherited from interface com.mojang.serialization.Encoder
comap, encodeStart, flatComap
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Field Details
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER -
byId
-
toId
-
storage
-
keyStorage
-
lifecycles
-
elementsLifecycle
private com.mojang.serialization.Lifecycle elementsLifecycle -
randomCache
-
nextId
private int nextId
-
-
Constructor Details
-
MappedRegistry
public MappedRegistry(ResourceKey<? extends Registry<T>> p_122681_, com.mojang.serialization.Lifecycle p_122682_)
-
-
Method Details
-
withNameAndId
public static <T> com.mojang.serialization.MapCodec<MappedRegistry.RegistryEntry<T>> withNameAndId(ResourceKey<? extends Registry<T>> p_122728_, com.mojang.serialization.MapCodec<T> p_122729_) -
registerMapping
public <V extends T> V registerMapping(int p_122686_, ResourceKey<T> p_122687_, V p_122688_, com.mojang.serialization.Lifecycle p_122689_)- Specified by:
registerMapping
in classWritableRegistry<T>
-
registerMapping
private <V extends T> V registerMapping(int p_122691_, ResourceKey<T> p_122692_, V p_122693_, com.mojang.serialization.Lifecycle p_122694_, boolean p_122695_) -
register
public <V extends T> V register(ResourceKey<T> p_122735_, V p_122736_, com.mojang.serialization.Lifecycle p_122737_)- Specified by:
register
in classWritableRegistry<T>
-
registerOrOverride
public <V extends T> V registerOrOverride(OptionalInt p_122708_, ResourceKey<T> p_122709_, V p_122710_, com.mojang.serialization.Lifecycle p_122711_)- Specified by:
registerOrOverride
in classWritableRegistry<T>
-
getKey
-
getResourceKey
- Specified by:
getResourceKey
in classRegistry<T>
-
getId
-
get
-
byId
-
lifecycle
-
elementsLifecycle
public com.mojang.serialization.Lifecycle elementsLifecycle()- Specified by:
elementsLifecycle
in classRegistry<T>
-
iterator
-
get
-
keySet
-
entrySet
-
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>
-
networkCodec
public static <T> com.mojang.serialization.Codec<MappedRegistry<T>> networkCodec(ResourceKey<? extends Registry<T>> p_122716_, com.mojang.serialization.Lifecycle p_122717_, com.mojang.serialization.Codec<T> p_122718_) -
dataPackCodec
public static <T> com.mojang.serialization.Codec<MappedRegistry<T>> dataPackCodec(ResourceKey<? extends Registry<T>> p_122748_, com.mojang.serialization.Lifecycle p_122749_, com.mojang.serialization.Codec<T> p_122750_) -
directCodec
public static <T> com.mojang.serialization.Codec<MappedRegistry<T>> directCodec(ResourceKey<? extends Registry<T>> p_122757_, com.mojang.serialization.Lifecycle p_122758_, com.mojang.serialization.Codec<T> p_122759_)
-