package net.minecraft.core.registries; import com.mojang.serialization.MapCodec; import java.util.function.Consumer; import net.minecraft.advancements.Advancement; import net.minecraft.advancements.CriterionTrigger; import net.minecraft.advancements.critereon.EntitySubPredicate; import net.minecraft.commands.synchronization.ArgumentTypeInfo; import net.minecraft.core.Registry; import net.minecraft.core.component.DataComponentType; import net.minecraft.core.component.predicates.DataComponentPredicate; import net.minecraft.core.particles.ParticleType; import net.minecraft.gametest.framework.GameTestHelper; import net.minecraft.gametest.framework.GameTestInstance; import net.minecraft.gametest.framework.TestEnvironmentDefinition; import net.minecraft.network.chat.ChatType; import net.minecraft.network.chat.numbers.NumberFormatType; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.level.TicketType; import net.minecraft.sounds.SoundEvent; import net.minecraft.stats.StatType; import net.minecraft.util.valueproviders.FloatProviderType; import net.minecraft.util.valueproviders.IntProviderType; import net.minecraft.world.damagesource.DamageType; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.memory.MemoryModuleType; import net.minecraft.world.entity.ai.sensing.SensorType; import net.minecraft.world.entity.ai.village.poi.PoiType; import net.minecraft.world.entity.animal.CatVariant; import net.minecraft.world.entity.animal.ChickenVariant; import net.minecraft.world.entity.animal.CowVariant; import net.minecraft.world.entity.animal.PigVariant; import net.minecraft.world.entity.animal.frog.FrogVariant; import net.minecraft.world.entity.animal.wolf.WolfSoundVariant; import net.minecraft.world.entity.animal.wolf.WolfVariant; import net.minecraft.world.entity.decoration.PaintingVariant; import net.minecraft.world.entity.npc.VillagerProfession; import net.minecraft.world.entity.npc.VillagerType; import net.minecraft.world.entity.schedule.Activity; import net.minecraft.world.entity.schedule.Schedule; import net.minecraft.world.entity.variant.SpawnCondition; import net.minecraft.world.inventory.MenuType; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.Instrument; import net.minecraft.world.item.Item; import net.minecraft.world.item.JukeboxSong; import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.consume_effects.ConsumeEffect.Type; import net.minecraft.world.item.crafting.Recipe; import net.minecraft.world.item.crafting.RecipeBookCategory; import net.minecraft.world.item.crafting.RecipeSerializer; import net.minecraft.world.item.crafting.RecipeType; import net.minecraft.world.item.crafting.display.SlotDisplay; import net.minecraft.world.item.enchantment.Enchantment; import net.minecraft.world.item.enchantment.LevelBasedValue; import net.minecraft.world.item.enchantment.effects.EnchantmentEntityEffect; import net.minecraft.world.item.enchantment.effects.EnchantmentLocationBasedEffect; import net.minecraft.world.item.enchantment.effects.EnchantmentValueEffect; import net.minecraft.world.item.enchantment.providers.EnchantmentProvider; import net.minecraft.world.item.equipment.trim.TrimMaterial; import net.minecraft.world.item.equipment.trim.TrimPattern; import net.minecraft.world.level.Level; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.biome.BiomeSource; import net.minecraft.world.level.biome.MultiNoiseBiomeSourceParameterList; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.entity.BannerPattern; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.DecoratedPotPattern; import net.minecraft.world.level.block.entity.trialspawner.TrialSpawnerConfig; import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.status.ChunkStatus; import net.minecraft.world.level.dimension.DimensionType; import net.minecraft.world.level.dimension.LevelStem; import net.minecraft.world.level.gameevent.GameEvent; import net.minecraft.world.level.gameevent.PositionSourceType; import net.minecraft.world.level.levelgen.DensityFunction; import net.minecraft.world.level.levelgen.NoiseGeneratorSettings; import net.minecraft.world.level.levelgen.SurfaceRules.ConditionSource; import net.minecraft.world.level.levelgen.SurfaceRules.RuleSource; import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicateType; import net.minecraft.world.level.levelgen.carver.ConfiguredWorldCarver; import net.minecraft.world.level.levelgen.carver.WorldCarver; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.feature.Feature; import net.minecraft.world.level.levelgen.feature.featuresize.FeatureSizeType; import net.minecraft.world.level.levelgen.feature.foliageplacers.FoliagePlacerType; import net.minecraft.world.level.levelgen.feature.rootplacers.RootPlacerType; import net.minecraft.world.level.levelgen.feature.stateproviders.BlockStateProviderType; import net.minecraft.world.level.levelgen.feature.treedecorators.TreeDecoratorType; import net.minecraft.world.level.levelgen.feature.trunkplacers.TrunkPlacerType; import net.minecraft.world.level.levelgen.flat.FlatLevelGeneratorPreset; import net.minecraft.world.level.levelgen.heightproviders.HeightProviderType; import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacementModifierType; import net.minecraft.world.level.levelgen.presets.WorldPreset; import net.minecraft.world.level.levelgen.structure.Structure; import net.minecraft.world.level.levelgen.structure.StructureSet; import net.minecraft.world.level.levelgen.structure.StructureType; import net.minecraft.world.level.levelgen.structure.pieces.StructurePieceType; import net.minecraft.world.level.levelgen.structure.placement.StructurePlacementType; import net.minecraft.world.level.levelgen.structure.pools.StructurePoolElementType; import net.minecraft.world.level.levelgen.structure.pools.StructureTemplatePool; import net.minecraft.world.level.levelgen.structure.pools.alias.PoolAliasBinding; import net.minecraft.world.level.levelgen.structure.templatesystem.PosRuleTestType; import net.minecraft.world.level.levelgen.structure.templatesystem.RuleTestType; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorList; import net.minecraft.world.level.levelgen.structure.templatesystem.StructureProcessorType; import net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentity.RuleBlockEntityModifierType; import net.minecraft.world.level.levelgen.synth.NormalNoise.NoiseParameters; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.saveddata.maps.MapDecorationType; import net.minecraft.world.level.storage.loot.LootTable; import net.minecraft.world.level.storage.loot.entries.LootPoolEntryType; import net.minecraft.world.level.storage.loot.functions.LootItemFunction; import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; import net.minecraft.world.level.storage.loot.predicates.LootItemCondition; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; import net.minecraft.world.level.storage.loot.providers.nbt.LootNbtProviderType; import net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType; import net.minecraft.world.level.storage.loot.providers.score.LootScoreProviderType; public class Registries { public static final ResourceLocation ROOT_REGISTRY_NAME = ResourceLocation.withDefaultNamespace("root"); public static final ResourceKey> ACTIVITY = createRegistryKey("activity"); public static final ResourceKey> ATTRIBUTE = createRegistryKey("attribute"); public static final ResourceKey>> BIOME_SOURCE = createRegistryKey("worldgen/biome_source"); public static final ResourceKey>> BLOCK_ENTITY_TYPE = createRegistryKey("block_entity_type"); public static final ResourceKey>> BLOCK_PREDICATE_TYPE = createRegistryKey("block_predicate_type"); public static final ResourceKey>> BLOCK_STATE_PROVIDER_TYPE = createRegistryKey("worldgen/block_state_provider_type"); public static final ResourceKey>> BLOCK_TYPE = createRegistryKey("block_type"); public static final ResourceKey> BLOCK = createRegistryKey("block"); public static final ResourceKey>> CARVER = createRegistryKey("worldgen/carver"); public static final ResourceKey>> CHUNK_GENERATOR = createRegistryKey("worldgen/chunk_generator"); public static final ResourceKey> CHUNK_STATUS = createRegistryKey("chunk_status"); public static final ResourceKey>> COMMAND_ARGUMENT_TYPE = createRegistryKey("command_argument_type"); public static final ResourceKey>> CONSUME_EFFECT_TYPE = createRegistryKey("consume_effect_type"); public static final ResourceKey> CREATIVE_MODE_TAB = createRegistryKey("creative_mode_tab"); public static final ResourceKey> CUSTOM_STAT = createRegistryKey("custom_stat"); public static final ResourceKey>> DATA_COMPONENT_PREDICATE_TYPE = createRegistryKey("data_component_predicate_type"); public static final ResourceKey>> DATA_COMPONENT_TYPE = createRegistryKey("data_component_type"); public static final ResourceKey> DECORATED_POT_PATTERN = createRegistryKey("decorated_pot_pattern"); public static final ResourceKey>> DENSITY_FUNCTION_TYPE = createRegistryKey("worldgen/density_function_type"); public static final ResourceKey>> ENCHANTMENT_EFFECT_COMPONENT_TYPE = createRegistryKey("enchantment_effect_component_type"); public static final ResourceKey>> ENCHANTMENT_ENTITY_EFFECT_TYPE = createRegistryKey( "enchantment_entity_effect_type" ); public static final ResourceKey>> ENCHANTMENT_LEVEL_BASED_VALUE_TYPE = createRegistryKey( "enchantment_level_based_value_type" ); public static final ResourceKey>> ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE = createRegistryKey( "enchantment_location_based_effect_type" ); public static final ResourceKey>> ENCHANTMENT_PROVIDER_TYPE = createRegistryKey("enchantment_provider_type"); public static final ResourceKey>> ENCHANTMENT_VALUE_EFFECT_TYPE = createRegistryKey( "enchantment_value_effect_type" ); public static final ResourceKey>> ENTITY_SUB_PREDICATE_TYPE = createRegistryKey("entity_sub_predicate_type"); public static final ResourceKey>> ENTITY_TYPE = createRegistryKey("entity_type"); public static final ResourceKey>> FEATURE_SIZE_TYPE = createRegistryKey("worldgen/feature_size_type"); public static final ResourceKey>> FEATURE = createRegistryKey("worldgen/feature"); public static final ResourceKey>> FLOAT_PROVIDER_TYPE = createRegistryKey("float_provider_type"); public static final ResourceKey> FLUID = createRegistryKey("fluid"); public static final ResourceKey>> FOLIAGE_PLACER_TYPE = createRegistryKey("worldgen/foliage_placer_type"); public static final ResourceKey> GAME_EVENT = createRegistryKey("game_event"); public static final ResourceKey>> HEIGHT_PROVIDER_TYPE = createRegistryKey("height_provider_type"); public static final ResourceKey>> INT_PROVIDER_TYPE = createRegistryKey("int_provider_type"); public static final ResourceKey> ITEM = createRegistryKey("item"); public static final ResourceKey> LOOT_CONDITION_TYPE = createRegistryKey("loot_condition_type"); public static final ResourceKey>> LOOT_FUNCTION_TYPE = createRegistryKey("loot_function_type"); public static final ResourceKey> LOOT_NBT_PROVIDER_TYPE = createRegistryKey("loot_nbt_provider_type"); public static final ResourceKey> LOOT_NUMBER_PROVIDER_TYPE = createRegistryKey("loot_number_provider_type"); public static final ResourceKey> LOOT_POOL_ENTRY_TYPE = createRegistryKey("loot_pool_entry_type"); public static final ResourceKey> LOOT_SCORE_PROVIDER_TYPE = createRegistryKey("loot_score_provider_type"); public static final ResourceKey> MAP_DECORATION_TYPE = createRegistryKey("map_decoration_type"); public static final ResourceKey>> MATERIAL_CONDITION = createRegistryKey("worldgen/material_condition"); public static final ResourceKey>> MATERIAL_RULE = createRegistryKey("worldgen/material_rule"); public static final ResourceKey>> MEMORY_MODULE_TYPE = createRegistryKey("memory_module_type"); public static final ResourceKey>> MENU = createRegistryKey("menu"); public static final ResourceKey> MOB_EFFECT = createRegistryKey("mob_effect"); public static final ResourceKey>> NUMBER_FORMAT_TYPE = createRegistryKey("number_format_type"); public static final ResourceKey>> PARTICLE_TYPE = createRegistryKey("particle_type"); public static final ResourceKey>> PLACEMENT_MODIFIER_TYPE = createRegistryKey("worldgen/placement_modifier_type"); public static final ResourceKey> POINT_OF_INTEREST_TYPE = createRegistryKey("point_of_interest_type"); public static final ResourceKey>> POOL_ALIAS_BINDING = createRegistryKey("worldgen/pool_alias_binding"); public static final ResourceKey>> POSITION_SOURCE_TYPE = createRegistryKey("position_source_type"); public static final ResourceKey>> POS_RULE_TEST = createRegistryKey("pos_rule_test"); public static final ResourceKey> POTION = createRegistryKey("potion"); public static final ResourceKey> RECIPE_BOOK_CATEGORY = createRegistryKey("recipe_book_category"); public static final ResourceKey>> RECIPE_DISPLAY = createRegistryKey("recipe_display"); public static final ResourceKey>> RECIPE_SERIALIZER = createRegistryKey("recipe_serializer"); public static final ResourceKey>> RECIPE_TYPE = createRegistryKey("recipe_type"); public static final ResourceKey>> ROOT_PLACER_TYPE = createRegistryKey("worldgen/root_placer_type"); public static final ResourceKey>> RULE_BLOCK_ENTITY_MODIFIER = createRegistryKey("rule_block_entity_modifier"); public static final ResourceKey>> RULE_TEST = createRegistryKey("rule_test"); public static final ResourceKey> SCHEDULE = createRegistryKey("schedule"); public static final ResourceKey>> SENSOR_TYPE = createRegistryKey("sensor_type"); public static final ResourceKey>> SLOT_DISPLAY = createRegistryKey("slot_display"); public static final ResourceKey> SOUND_EVENT = createRegistryKey("sound_event"); public static final ResourceKey>> SPAWN_CONDITION_TYPE = createRegistryKey("spawn_condition_type"); public static final ResourceKey>> STAT_TYPE = createRegistryKey("stat_type"); public static final ResourceKey> STRUCTURE_PIECE = createRegistryKey("worldgen/structure_piece"); public static final ResourceKey>> STRUCTURE_PLACEMENT = createRegistryKey("worldgen/structure_placement"); public static final ResourceKey>> STRUCTURE_POOL_ELEMENT = createRegistryKey("worldgen/structure_pool_element"); public static final ResourceKey>> STRUCTURE_PROCESSOR = createRegistryKey("worldgen/structure_processor"); public static final ResourceKey>> STRUCTURE_TYPE = createRegistryKey("worldgen/structure_type"); public static final ResourceKey>> TEST_ENVIRONMENT_DEFINITION_TYPE = createRegistryKey( "test_environment_definition_type" ); public static final ResourceKey>> TEST_FUNCTION = createRegistryKey("test_function"); public static final ResourceKey>> TEST_INSTANCE_TYPE = createRegistryKey("test_instance_type"); public static final ResourceKey> TICKET_TYPE = createRegistryKey("ticket_type"); public static final ResourceKey>> TREE_DECORATOR_TYPE = createRegistryKey("worldgen/tree_decorator_type"); public static final ResourceKey>> TRUNK_PLACER_TYPE = createRegistryKey("worldgen/trunk_placer_type"); public static final ResourceKey> VILLAGER_PROFESSION = createRegistryKey("villager_profession"); public static final ResourceKey> VILLAGER_TYPE = createRegistryKey("villager_type"); public static final ResourceKey> BANNER_PATTERN = createRegistryKey("banner_pattern"); public static final ResourceKey> BIOME = createRegistryKey("worldgen/biome"); public static final ResourceKey> CAT_VARIANT = createRegistryKey("cat_variant"); public static final ResourceKey> CHAT_TYPE = createRegistryKey("chat_type"); public static final ResourceKey> CHICKEN_VARIANT = createRegistryKey("chicken_variant"); public static final ResourceKey>> CONFIGURED_CARVER = createRegistryKey("worldgen/configured_carver"); public static final ResourceKey>> CONFIGURED_FEATURE = createRegistryKey("worldgen/configured_feature"); public static final ResourceKey> COW_VARIANT = createRegistryKey("cow_variant"); public static final ResourceKey> DAMAGE_TYPE = createRegistryKey("damage_type"); public static final ResourceKey> DENSITY_FUNCTION = createRegistryKey("worldgen/density_function"); public static final ResourceKey> DIMENSION_TYPE = createRegistryKey("dimension_type"); public static final ResourceKey> ENCHANTMENT_PROVIDER = createRegistryKey("enchantment_provider"); public static final ResourceKey> ENCHANTMENT = createRegistryKey("enchantment"); public static final ResourceKey> FLAT_LEVEL_GENERATOR_PRESET = createRegistryKey("worldgen/flat_level_generator_preset"); public static final ResourceKey> FROG_VARIANT = createRegistryKey("frog_variant"); public static final ResourceKey> INSTRUMENT = createRegistryKey("instrument"); public static final ResourceKey> JUKEBOX_SONG = createRegistryKey("jukebox_song"); public static final ResourceKey> MULTI_NOISE_BIOME_SOURCE_PARAMETER_LIST = createRegistryKey( "worldgen/multi_noise_biome_source_parameter_list" ); public static final ResourceKey> NOISE_SETTINGS = createRegistryKey("worldgen/noise_settings"); public static final ResourceKey> NOISE = createRegistryKey("worldgen/noise"); public static final ResourceKey> PAINTING_VARIANT = createRegistryKey("painting_variant"); public static final ResourceKey> PIG_VARIANT = createRegistryKey("pig_variant"); public static final ResourceKey> PLACED_FEATURE = createRegistryKey("worldgen/placed_feature"); public static final ResourceKey> PROCESSOR_LIST = createRegistryKey("worldgen/processor_list"); public static final ResourceKey> STRUCTURE_SET = createRegistryKey("worldgen/structure_set"); public static final ResourceKey> STRUCTURE = createRegistryKey("worldgen/structure"); public static final ResourceKey> TEMPLATE_POOL = createRegistryKey("worldgen/template_pool"); public static final ResourceKey> TEST_ENVIRONMENT = createRegistryKey("test_environment"); public static final ResourceKey> TEST_INSTANCE = createRegistryKey("test_instance"); public static final ResourceKey> TRIAL_SPAWNER_CONFIG = createRegistryKey("trial_spawner"); public static final ResourceKey>> TRIGGER_TYPE = createRegistryKey("trigger_type"); public static final ResourceKey> TRIM_MATERIAL = createRegistryKey("trim_material"); public static final ResourceKey> TRIM_PATTERN = createRegistryKey("trim_pattern"); public static final ResourceKey> WOLF_VARIANT = createRegistryKey("wolf_variant"); public static final ResourceKey> WOLF_SOUND_VARIANT = createRegistryKey("wolf_sound_variant"); public static final ResourceKey> WORLD_PRESET = createRegistryKey("worldgen/world_preset"); public static final ResourceKey> DIMENSION = createRegistryKey("dimension"); public static final ResourceKey> LEVEL_STEM = createRegistryKey("dimension"); public static final ResourceKey> LOOT_TABLE = createRegistryKey("loot_table"); public static final ResourceKey> ITEM_MODIFIER = createRegistryKey("item_modifier"); public static final ResourceKey> PREDICATE = createRegistryKey("predicate"); public static final ResourceKey> ADVANCEMENT = createRegistryKey("advancement"); public static final ResourceKey>> RECIPE = createRegistryKey("recipe"); public static ResourceKey levelStemToLevel(ResourceKey levelStem) { return ResourceKey.create(DIMENSION, levelStem.location()); } public static ResourceKey levelToLevelStem(ResourceKey level) { return ResourceKey.create(LEVEL_STEM, level.location()); } private static ResourceKey> createRegistryKey(String name) { return ResourceKey.createRegistryKey(ResourceLocation.withDefaultNamespace(name)); } public static String elementsDirPath(ResourceKey> registryKey) { return registryKey.location().getPath(); } public static String tagsDirPath(ResourceKey> registryKey) { return "tags/" + registryKey.location().getPath(); } }