Package net.minecraft.core
Class Registry<T>
java.lang.Object
net.minecraft.core.Registry<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:
WritableRegistry
-
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 TypeFieldDescriptionDeprecated.static ResourceKey<Registry<Activity>>
Deprecated.static ResourceKey<Registry<Attribute>>
static ResourceKey<Registry<Biome>>
static Registry<com.mojang.serialization.Codec<? extends BiomeSource>>
static ResourceKey<Registry<com.mojang.serialization.Codec<? extends BiomeSource>>>
static DefaultedRegistry<Block>
Deprecated.static Registry<BlockEntityType<?>>
Deprecated.static ResourceKey<Registry<BlockEntityType<?>>>
static ResourceKey<Registry<BlockPlacerType<?>>>
static Registry<BlockPlacerType<?>>
Deprecated.static ResourceKey<Registry<Block>>
static ResourceKey<Registry<BlockStateProviderType<?>>>
static Registry<BlockStateProviderType<?>>
Deprecated.static Registry<WorldCarver<?>>
Deprecated.static ResourceKey<Registry<WorldCarver<?>>>
static Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>
static ResourceKey<Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>>
static DefaultedRegistry<ChunkStatus>
Deprecated.static ResourceKey<Registry<ChunkStatus>>
static ResourceKey<Registry<ConfiguredWorldCarver<?>>>
static ResourceKey<Registry<ConfiguredFeature<?,?>>>
static ResourceKey<Registry<ConfiguredStructureFeature<?,?>>>
static ResourceKey<Registry<ConfiguredSurfaceBuilder<?>>>
static Registry<ResourceLocation>
static ResourceKey<Registry<ResourceLocation>>
static Registry<FeatureDecorator<?>>
Deprecated.static ResourceKey<Registry<FeatureDecorator<?>>>
static ResourceKey<Registry<Level>>
static ResourceKey<Registry<DimensionType>>
static Registry<Enchantment>
Deprecated.static ResourceKey<Registry<Enchantment>>
static DefaultedRegistry<EntityType<?>>
Deprecated.static ResourceKey<Registry<EntityType<?>>>
Deprecated.static ResourceKey<Registry<Feature<?>>>
static ResourceKey<Registry<FeatureSizeType<?>>>
static Registry<FeatureSizeType<?>>
static ResourceKey<Registry<FloatProviderType<?>>>
static Registry<FloatProviderType<?>>
static DefaultedRegistry<Fluid>
Deprecated.static ResourceKey<Registry<Fluid>>
static ResourceKey<Registry<FoliagePlacerType<?>>>
static Registry<FoliagePlacerType<?>>
Deprecated.static DefaultedRegistry<GameEvent>
static ResourceKey<Registry<GameEvent>>
static ResourceKey<Registry<HeightProviderType<?>>>
static Registry<HeightProviderType<?>>
static ResourceKey<Registry<IntProviderType<?>>>
static Registry<IntProviderType<?>>
static DefaultedRegistry<Item>
Deprecated.static ResourceKey<Registry<Item>>
private ResourceKey<? extends Registry<T>>
static ResourceKey<Registry<LevelStem>>
private com.mojang.serialization.Lifecycle
private static Map<ResourceLocation,Supplier<?>>
protected static org.apache.logging.log4j.Logger
static Registry<LootItemConditionType>
static ResourceKey<Registry<LootPoolEntryType>>
static ResourceKey<Registry<LootItemFunctionType>>
static Registry<LootItemFunctionType>
static ResourceKey<Registry<LootItemConditionType>>
static ResourceKey<Registry<LootNbtProviderType>>
static Registry<LootNbtProviderType>
static ResourceKey<Registry<LootNumberProviderType>>
static Registry<LootNumberProviderType>
static Registry<LootPoolEntryType>
static ResourceKey<Registry<LootScoreProviderType>>
static Registry<LootScoreProviderType>
static DefaultedRegistry<MemoryModuleType<?>>
Deprecated.static ResourceKey<Registry<MemoryModuleType<?>>>
Deprecated.static ResourceKey<Registry<MenuType<?>>>
Deprecated.static ResourceKey<Registry<MobEffect>>
static DefaultedRegistry<Motive>
Deprecated.static ResourceKey<Registry<Motive>>
static ResourceKey<Registry<NoiseGeneratorSettings>>
static Registry<ParticleType<?>>
Deprecated.static ResourceKey<Registry<ParticleType<?>>>
static DefaultedRegistry<PoiType>
Deprecated.static ResourceKey<Registry<PoiType>>
static Registry<PosRuleTestType<?>>
static ResourceKey<Registry<PosRuleTestType<?>>>
static Registry<PositionSourceType<?>>
static ResourceKey<Registry<PositionSourceType<?>>>
static DefaultedRegistry<Potion>
Deprecated.static ResourceKey<Registry<Potion>>
static ResourceKey<Registry<StructureProcessorList>>
static Registry<RecipeSerializer<?>>
Deprecated.static ResourceKey<Registry<RecipeSerializer<?>>>
static Registry<RecipeType<?>>
static ResourceKey<Registry<RecipeType<?>>>
static ResourceLocation
static Registry<RuleTestType<?>>
static ResourceKey<Registry<RuleTestType<?>>>
Deprecated.static ResourceKey<Registry<Schedule>>
static DefaultedRegistry<SensorType<?>>
Deprecated.static ResourceKey<Registry<SensorType<?>>>
static Registry<SoundEvent>
Deprecated.static ResourceKey<Registry<SoundEvent>>
Deprecated.static ResourceKey<Registry<StatType<?>>>
static Registry<StructureFeature<?>>
Deprecated.static ResourceKey<Registry<StructureFeature<?>>>
static Registry<StructurePieceType>
static ResourceKey<Registry<StructurePieceType>>
static Registry<StructurePoolElementType<?>>
static ResourceKey<Registry<StructurePoolElementType<?>>>
static Registry<StructureProcessorType<?>>
static ResourceKey<Registry<StructureProcessorType<?>>>
static Registry<SurfaceBuilder<?>>
Deprecated.static ResourceKey<Registry<SurfaceBuilder<?>>>
static ResourceKey<Registry<StructureTemplatePool>>
static ResourceKey<Registry<TreeDecoratorType<?>>>
static Registry<TreeDecoratorType<?>>
Deprecated.static ResourceKey<Registry<TrunkPlacerType<?>>>
static Registry<TrunkPlacerType<?>>
static DefaultedRegistry<VillagerProfession>
Deprecated.static ResourceKey<Registry<VillagerProfession>>
static DefaultedRegistry<VillagerType>
static ResourceKey<Registry<VillagerType>>
protected static WritableRegistry<WritableRegistry<?>>
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
ModifierConstructorDescriptionprotected
Registry(ResourceKey<? extends Registry<T>> p_122920_, com.mojang.serialization.Lifecycle p_122921_)
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends WritableRegistry<?>>
voidcheckRegistry(WritableRegistry<T> p_122970_)
abstract boolean
containsKey(ResourceKey<T> p_175475_)
abstract boolean
containsKey(ResourceLocation p_123011_)
private static <T> ResourceKey<Registry<T>>
createRegistryKey(String p_122979_)
<U> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<T,U>>
decode(com.mojang.serialization.DynamicOps<U> p_123016_, U p_123017_)
abstract com.mojang.serialization.Lifecycle
<U> com.mojang.serialization.DataResult<U>
abstract Set<Map.Entry<ResourceKey<T>,T>>
entrySet()
private static <T extends IForgeRegistryEntry<T>>
Registry<T>forge(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle cycle, Supplier<T> def)
private static <T extends IForgeRegistryEntry<T>>
DefaultedRegistry<T>forge(ResourceKey<? extends Registry<T>> key, String defKey, com.mojang.serialization.Lifecycle cycle, Supplier<T> def)
private static <T extends IForgeRegistryEntry<T>>
DefaultedRegistry<T>forge(ResourceKey<? extends Registry<T>> key, String defKey, Supplier<T> def)
private static <T extends IForgeRegistryEntry<T>>
Registry<T>forge(ResourceKey<? extends Registry<T>> key, Supplier<T> def)
abstract T
get(ResourceKey<T> p_122980_)
abstract T
get(ResourceLocation p_123002_)
abstract int
abstract ResourceLocation
getOptional(ResourceKey<T> p_123010_)
getOptional(ResourceLocation p_123007_)
getOrThrow(ResourceKey<T> p_123014_)
abstract T
abstract Optional<ResourceKey<T>>
getResourceKey(T p_123008_)
private static <T, R extends WritableRegistry<T>>
RinternalRegister(ResourceKey<? extends Registry<T>> p_122986_, R p_122987_, Supplier<T> p_122988_, com.mojang.serialization.Lifecycle p_122989_)
ResourceKey<? extends Registry<T>>
key()
<U> Stream<U>
keys(com.mojang.serialization.DynamicOps<U> p_123030_)
abstract Set<ResourceLocation>
keySet()
protected abstract com.mojang.serialization.Lifecycle
static <T> T
static <V, T extends V>
Tregister(Registry<V> p_122966_, ResourceLocation p_122967_, T p_122968_)
private static <T> DefaultedRegistry<T>
registerDefaulted(ResourceKey<? extends Registry<T>> p_122991_, String p_122992_, com.mojang.serialization.Lifecycle p_122993_, Supplier<T> p_122994_)
private static <T> DefaultedRegistry<T>
registerDefaulted(ResourceKey<? extends Registry<T>> p_122996_, String p_122997_, Supplier<T> p_122998_)
static <V, T extends V>
TregisterMapping(Registry<V> p_122957_, int p_122958_, String p_122959_, T p_122960_)
private static <T> Registry<T>
registerSimple(ResourceKey<? extends Registry<T>> p_122982_, com.mojang.serialization.Lifecycle p_122983_, Supplier<T> p_122984_)
private static <T> Registry<T>
registerSimple(ResourceKey<? extends Registry<T>> p_123000_, Supplier<T> p_123001_)
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, iterator, spliterator
-
Field Details
-
LOGGER
protected static final org.apache.logging.log4j.Logger LOGGER -
LOADERS
-
ROOT_REGISTRY_NAME
-
WRITABLE_REGISTRY
-
REGISTRY
-
SOUND_EVENT_REGISTRY
-
FLUID_REGISTRY
-
MOB_EFFECT_REGISTRY
-
BLOCK_REGISTRY
-
ENCHANTMENT_REGISTRY
-
ENTITY_TYPE_REGISTRY
-
ITEM_REGISTRY
-
POTION_REGISTRY
-
PARTICLE_TYPE_REGISTRY
-
BLOCK_ENTITY_TYPE_REGISTRY
-
MOTIVE_REGISTRY
-
CUSTOM_STAT_REGISTRY
-
CHUNK_STATUS_REGISTRY
-
RULE_TEST_REGISTRY
-
POS_RULE_TEST_REGISTRY
-
MENU_REGISTRY
-
RECIPE_TYPE_REGISTRY
-
RECIPE_SERIALIZER_REGISTRY
-
ATTRIBUTE_REGISTRY
-
GAME_EVENT_REGISTRY
-
POSITION_SOURCE_TYPE_REGISTRY
-
STAT_TYPE_REGISTRY
-
VILLAGER_TYPE_REGISTRY
-
VILLAGER_PROFESSION_REGISTRY
-
POINT_OF_INTEREST_TYPE_REGISTRY
-
MEMORY_MODULE_TYPE_REGISTRY
-
SENSOR_TYPE_REGISTRY
-
SCHEDULE_REGISTRY
-
ACTIVITY_REGISTRY
-
LOOT_ENTRY_REGISTRY
-
LOOT_FUNCTION_REGISTRY
-
LOOT_ITEM_REGISTRY
-
LOOT_NUMBER_PROVIDER_REGISTRY
-
LOOT_NBT_PROVIDER_REGISTRY
-
LOOT_SCORE_PROVIDER_REGISTRY
-
DIMENSION_TYPE_REGISTRY
-
DIMENSION_REGISTRY
-
LEVEL_STEM_REGISTRY
-
GAME_EVENT
-
SOUND_EVENT
Deprecated. -
FLUID
Deprecated. -
MOB_EFFECT
Deprecated. -
BLOCK
Deprecated. -
ENCHANTMENT
Deprecated. -
ENTITY_TYPE
Deprecated. -
ITEM
Deprecated. -
POTION
Deprecated. -
PARTICLE_TYPE
Deprecated. -
BLOCK_ENTITY_TYPE
Deprecated. -
MOTIVE
Deprecated. -
CUSTOM_STAT
-
CHUNK_STATUS
Deprecated. -
RULE_TEST
-
POS_RULE_TEST
-
MENU
Deprecated. -
RECIPE_TYPE
-
RECIPE_SERIALIZER
Deprecated. -
ATTRIBUTE
Deprecated. -
POSITION_SOURCE_TYPE
-
STAT_TYPE
Deprecated. -
VILLAGER_TYPE
-
VILLAGER_PROFESSION
Deprecated. -
POINT_OF_INTEREST_TYPE
Deprecated. -
MEMORY_MODULE_TYPE
Deprecated. -
SENSOR_TYPE
Deprecated. -
SCHEDULE
Deprecated. -
ACTIVITY
Deprecated. -
LOOT_POOL_ENTRY_TYPE
-
LOOT_FUNCTION_TYPE
-
LOOT_CONDITION_TYPE
-
LOOT_NUMBER_PROVIDER_TYPE
-
LOOT_NBT_PROVIDER_TYPE
-
LOOT_SCORE_PROVIDER_TYPE
-
FLOAT_PROVIDER_TYPE_REGISTRY
-
FLOAT_PROVIDER_TYPES
-
INT_PROVIDER_TYPE_REGISTRY
-
INT_PROVIDER_TYPES
-
HEIGHT_PROVIDER_TYPE_REGISTRY
-
HEIGHT_PROVIDER_TYPES
-
NOISE_GENERATOR_SETTINGS_REGISTRY
-
CONFIGURED_SURFACE_BUILDER_REGISTRY
public static final ResourceKey<Registry<ConfiguredSurfaceBuilder<?>>> CONFIGURED_SURFACE_BUILDER_REGISTRY -
CONFIGURED_CARVER_REGISTRY
-
CONFIGURED_FEATURE_REGISTRY
-
CONFIGURED_STRUCTURE_FEATURE_REGISTRY
public static final ResourceKey<Registry<ConfiguredStructureFeature<?,?>>> CONFIGURED_STRUCTURE_FEATURE_REGISTRY -
PROCESSOR_LIST_REGISTRY
-
TEMPLATE_POOL_REGISTRY
-
BIOME_REGISTRY
-
SURFACE_BUILDER_REGISTRY
-
SURFACE_BUILDER
Deprecated. -
CARVER_REGISTRY
-
CARVER
Deprecated. -
FEATURE_REGISTRY
-
FEATURE
Deprecated. -
STRUCTURE_FEATURE_REGISTRY
-
STRUCTURE_FEATURE
Deprecated. -
STRUCTURE_PIECE_REGISTRY
-
STRUCTURE_PIECE
-
DECORATOR_REGISTRY
-
DECORATOR
Deprecated. -
BLOCK_STATE_PROVIDER_TYPE_REGISTRY
public static final ResourceKey<Registry<BlockStateProviderType<?>>> BLOCK_STATE_PROVIDER_TYPE_REGISTRY -
BLOCK_PLACER_TYPE_REGISTRY
-
FOLIAGE_PLACER_TYPE_REGISTRY
-
TRUNK_PLACER_TYPE_REGISTRY
-
TREE_DECORATOR_TYPE_REGISTRY
-
FEATURE_SIZE_TYPE_REGISTRY
-
BIOME_SOURCE_REGISTRY
public static final ResourceKey<Registry<com.mojang.serialization.Codec<? extends BiomeSource>>> BIOME_SOURCE_REGISTRY -
CHUNK_GENERATOR_REGISTRY
public static final ResourceKey<Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>>> CHUNK_GENERATOR_REGISTRY -
STRUCTURE_PROCESSOR_REGISTRY
-
STRUCTURE_POOL_ELEMENT_REGISTRY
public static final ResourceKey<Registry<StructurePoolElementType<?>>> STRUCTURE_POOL_ELEMENT_REGISTRY -
BLOCKSTATE_PROVIDER_TYPES
Deprecated. -
BLOCK_PLACER_TYPES
Deprecated. -
FOLIAGE_PLACER_TYPES
Deprecated. -
TRUNK_PLACER_TYPES
-
TREE_DECORATOR_TYPES
Deprecated. -
FEATURE_SIZE_TYPES
-
BIOME_SOURCE
-
CHUNK_GENERATOR
public static final Registry<com.mojang.serialization.Codec<? extends ChunkGenerator>> CHUNK_GENERATOR -
STRUCTURE_PROCESSOR
-
STRUCTURE_POOL_ELEMENT
-
key
-
lifecycle
private final com.mojang.serialization.Lifecycle lifecycle
-
-
Constructor Details
-
Registry
protected Registry(ResourceKey<? extends Registry<T>> p_122920_, com.mojang.serialization.Lifecycle p_122921_)
-
-
Method Details
-
createRegistryKey
-
checkRegistry
-
registerSimple
private static <T> Registry<T> registerSimple(ResourceKey<? extends Registry<T>> p_123000_, Supplier<T> p_123001_) -
forge
private static <T extends IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, Supplier<T> def) -
registerDefaulted
private static <T> DefaultedRegistry<T> registerDefaulted(ResourceKey<? extends Registry<T>> p_122996_, String p_122997_, Supplier<T> p_122998_) -
forge
private static <T extends IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(ResourceKey<? extends Registry<T>> key, String defKey, Supplier<T> def) -
registerSimple
private static <T> Registry<T> registerSimple(ResourceKey<? extends Registry<T>> p_122982_, com.mojang.serialization.Lifecycle p_122983_, Supplier<T> p_122984_) -
forge
private static <T extends IForgeRegistryEntry<T>> Registry<T> forge(ResourceKey<? extends Registry<T>> key, com.mojang.serialization.Lifecycle cycle, Supplier<T> def) -
registerDefaulted
private static <T> DefaultedRegistry<T> registerDefaulted(ResourceKey<? extends Registry<T>> p_122991_, String p_122992_, com.mojang.serialization.Lifecycle p_122993_, Supplier<T> p_122994_) -
forge
private static <T extends IForgeRegistryEntry<T>> DefaultedRegistry<T> forge(ResourceKey<? extends Registry<T>> key, String defKey, com.mojang.serialization.Lifecycle cycle, Supplier<T> def) -
internalRegister
private static <T, R extends WritableRegistry<T>> R internalRegister(ResourceKey<? extends Registry<T>> p_122986_, R p_122987_, Supplier<T> p_122988_, com.mojang.serialization.Lifecycle p_122989_) -
key
-
toString
-
decode
public <U> com.mojang.serialization.DataResult<com.mojang.datafixers.util.Pair<T,U>> decode(com.mojang.serialization.DynamicOps<U> p_123016_, U p_123017_)- Specified by:
decode
in interfacecom.mojang.serialization.Decoder<T>
-
encode
public <U> com.mojang.serialization.DataResult<U> encode(T p_123020_, com.mojang.serialization.DynamicOps<U> p_123021_, U p_123022_)- Specified by:
encode
in interfacecom.mojang.serialization.Encoder<T>
-
keys
- Specified by:
keys
in interfacecom.mojang.serialization.Keyable
-
getKey
-
getResourceKey
-
getId
-
get
-
get
-
lifecycle
-
elementsLifecycle
public abstract com.mojang.serialization.Lifecycle elementsLifecycle() -
getOptional
-
getOptional
-
getOrThrow
-
keySet
-
entrySet
-
getRandom
-
stream
-
containsKey
-
containsKey
-
register
-
register
public static <V, T extends V> T register(Registry<V> p_122966_, ResourceLocation p_122967_, T p_122968_) -
registerMapping
-