package net.minecraft.core.registries; import com.google.common.collect.Maps; import com.mojang.logging.LogUtils; import com.mojang.serialization.Lifecycle; import com.mojang.serialization.MapCodec; import java.util.Map; import java.util.function.Consumer; import java.util.function.Supplier; import net.minecraft.Util; import net.minecraft.advancements.CriteriaTriggers; import net.minecraft.advancements.CriterionTrigger; import net.minecraft.advancements.critereon.EntitySubPredicate; import net.minecraft.advancements.critereon.EntitySubPredicates; import net.minecraft.commands.synchronization.ArgumentTypeInfo; import net.minecraft.commands.synchronization.ArgumentTypeInfos; import net.minecraft.core.DefaultedMappedRegistry; import net.minecraft.core.DefaultedRegistry; import net.minecraft.core.HolderGetter; import net.minecraft.core.MappedRegistry; import net.minecraft.core.RegistrationInfo; import net.minecraft.core.Registry; import net.minecraft.core.WritableRegistry; import net.minecraft.core.component.DataComponentType; import net.minecraft.core.component.DataComponents; import net.minecraft.core.component.predicates.DataComponentPredicate; import net.minecraft.core.component.predicates.DataComponentPredicates; import net.minecraft.core.particles.ParticleType; import net.minecraft.core.particles.ParticleTypes; import net.minecraft.gametest.framework.BuiltinTestFunctions; import net.minecraft.gametest.framework.GameTestHelper; import net.minecraft.gametest.framework.GameTestInstance; import net.minecraft.gametest.framework.TestEnvironmentDefinition; import net.minecraft.network.chat.numbers.NumberFormatType; import net.minecraft.network.chat.numbers.NumberFormatTypes; import net.minecraft.resources.ResourceKey; import net.minecraft.resources.ResourceLocation; import net.minecraft.server.Bootstrap; import net.minecraft.server.level.TicketType; import net.minecraft.sounds.SoundEvent; import net.minecraft.sounds.SoundEvents; import net.minecraft.stats.StatType; import net.minecraft.stats.Stats; import net.minecraft.util.valueproviders.FloatProviderType; import net.minecraft.util.valueproviders.IntProviderType; import net.minecraft.world.effect.MobEffect; import net.minecraft.world.effect.MobEffects; import net.minecraft.world.entity.EntityType; import net.minecraft.world.entity.ai.attributes.Attribute; import net.minecraft.world.entity.ai.attributes.Attributes; 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.ai.village.poi.PoiTypes; 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.entity.variant.SpawnConditions; import net.minecraft.world.inventory.MenuType; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.alchemy.Potion; import net.minecraft.world.item.alchemy.Potions; import net.minecraft.world.item.consume_effects.ConsumeEffect.Type; import net.minecraft.world.item.crafting.RecipeBookCategories; 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.RecipeDisplays; import net.minecraft.world.item.crafting.display.SlotDisplay; import net.minecraft.world.item.crafting.display.SlotDisplays; import net.minecraft.world.item.enchantment.EnchantmentEffectComponents; 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.enchantment.providers.EnchantmentProviderTypes; import net.minecraft.world.level.biome.BiomeSource; import net.minecraft.world.level.biome.BiomeSources; import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.BlockTypes; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.entity.DecoratedPotPattern; import net.minecraft.world.level.block.entity.DecoratedPotPatterns; import net.minecraft.world.level.chunk.ChunkGenerator; import net.minecraft.world.level.chunk.ChunkGenerators; import net.minecraft.world.level.chunk.status.ChunkStatus; 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.DensityFunctions; 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.WorldCarver; 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.heightproviders.HeightProviderType; import net.minecraft.world.level.levelgen.placement.PlacementModifierType; 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.alias.PoolAliasBinding; import net.minecraft.world.level.levelgen.structure.pools.alias.PoolAliasBindings; 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.StructureProcessorType; import net.minecraft.world.level.levelgen.structure.templatesystem.rule.blockentity.RuleBlockEntityModifierType; import net.minecraft.world.level.material.Fluid; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.saveddata.maps.MapDecorationType; import net.minecraft.world.level.saveddata.maps.MapDecorationTypes; import net.minecraft.world.level.storage.loot.entries.LootPoolEntries; import net.minecraft.world.level.storage.loot.entries.LootPoolEntryType; import net.minecraft.world.level.storage.loot.functions.LootItemFunctionType; import net.minecraft.world.level.storage.loot.functions.LootItemFunctions; import net.minecraft.world.level.storage.loot.predicates.LootItemConditionType; import net.minecraft.world.level.storage.loot.predicates.LootItemConditions; import net.minecraft.world.level.storage.loot.providers.nbt.LootNbtProviderType; import net.minecraft.world.level.storage.loot.providers.nbt.NbtProviders; import net.minecraft.world.level.storage.loot.providers.number.LootNumberProviderType; import net.minecraft.world.level.storage.loot.providers.number.NumberProviders; import net.minecraft.world.level.storage.loot.providers.score.LootScoreProviderType; import net.minecraft.world.level.storage.loot.providers.score.ScoreboardNameProviders; import org.apache.commons.lang3.Validate; import org.slf4j.Logger; public class BuiltInRegistries { private static final Logger LOGGER = LogUtils.getLogger(); private static final Map> LOADERS = Maps.>newLinkedHashMap(); private static final WritableRegistry> WRITABLE_REGISTRY = new MappedRegistry<>( ResourceKey.createRegistryKey(Registries.ROOT_REGISTRY_NAME), Lifecycle.stable() ); public static final DefaultedRegistry GAME_EVENT = registerDefaulted(Registries.GAME_EVENT, "step", GameEvent::bootstrap); public static final Registry SOUND_EVENT = registerSimple(Registries.SOUND_EVENT, registry -> SoundEvents.ITEM_PICKUP); public static final DefaultedRegistry FLUID = registerDefaultedWithIntrusiveHolders(Registries.FLUID, "empty", registry -> Fluids.EMPTY); public static final Registry MOB_EFFECT = registerSimple(Registries.MOB_EFFECT, MobEffects::bootstrap); public static final DefaultedRegistry BLOCK = registerDefaultedWithIntrusiveHolders(Registries.BLOCK, "air", registry -> Blocks.AIR); public static final DefaultedRegistry> ENTITY_TYPE = registerDefaultedWithIntrusiveHolders( Registries.ENTITY_TYPE, "pig", registry -> EntityType.PIG ); public static final DefaultedRegistry ITEM = registerDefaultedWithIntrusiveHolders(Registries.ITEM, "air", registry -> Items.AIR); public static final Registry POTION = registerSimple(Registries.POTION, Potions::bootstrap); public static final Registry> PARTICLE_TYPE = registerSimple(Registries.PARTICLE_TYPE, registry -> ParticleTypes.BLOCK); public static final Registry> BLOCK_ENTITY_TYPE = registerSimpleWithIntrusiveHolders( Registries.BLOCK_ENTITY_TYPE, registry -> BlockEntityType.FURNACE ); public static final Registry CUSTOM_STAT = registerSimple(Registries.CUSTOM_STAT, registry -> Stats.JUMP); public static final DefaultedRegistry CHUNK_STATUS = registerDefaulted(Registries.CHUNK_STATUS, "empty", registry -> ChunkStatus.EMPTY); public static final Registry> RULE_TEST = registerSimple(Registries.RULE_TEST, registry -> RuleTestType.ALWAYS_TRUE_TEST); public static final Registry> RULE_BLOCK_ENTITY_MODIFIER = registerSimple( Registries.RULE_BLOCK_ENTITY_MODIFIER, registry -> RuleBlockEntityModifierType.PASSTHROUGH ); public static final Registry> POS_RULE_TEST = registerSimple(Registries.POS_RULE_TEST, registry -> PosRuleTestType.ALWAYS_TRUE_TEST); public static final Registry> MENU = registerSimple(Registries.MENU, registry -> MenuType.ANVIL); public static final Registry> RECIPE_TYPE = registerSimple(Registries.RECIPE_TYPE, registry -> RecipeType.CRAFTING); public static final Registry> RECIPE_SERIALIZER = registerSimple( Registries.RECIPE_SERIALIZER, registry -> RecipeSerializer.SHAPELESS_RECIPE ); public static final Registry ATTRIBUTE = registerSimple(Registries.ATTRIBUTE, Attributes::bootstrap); public static final Registry> POSITION_SOURCE_TYPE = registerSimple( Registries.POSITION_SOURCE_TYPE, registry -> PositionSourceType.BLOCK ); public static final Registry> COMMAND_ARGUMENT_TYPE = registerSimple(Registries.COMMAND_ARGUMENT_TYPE, ArgumentTypeInfos::bootstrap); public static final Registry> STAT_TYPE = registerSimple(Registries.STAT_TYPE, registry -> Stats.ITEM_USED); public static final DefaultedRegistry VILLAGER_TYPE = registerDefaulted(Registries.VILLAGER_TYPE, "plains", VillagerType::bootstrap); public static final DefaultedRegistry VILLAGER_PROFESSION = registerDefaulted( Registries.VILLAGER_PROFESSION, "none", VillagerProfession::bootstrap ); public static final Registry POINT_OF_INTEREST_TYPE = registerSimple(Registries.POINT_OF_INTEREST_TYPE, PoiTypes::bootstrap); public static final DefaultedRegistry> MEMORY_MODULE_TYPE = registerDefaulted( Registries.MEMORY_MODULE_TYPE, "dummy", registry -> MemoryModuleType.DUMMY ); public static final DefaultedRegistry> SENSOR_TYPE = registerDefaulted(Registries.SENSOR_TYPE, "dummy", registry -> SensorType.DUMMY); public static final Registry SCHEDULE = registerSimple(Registries.SCHEDULE, registry -> Schedule.EMPTY); public static final Registry ACTIVITY = registerSimple(Registries.ACTIVITY, registry -> Activity.IDLE); public static final Registry LOOT_POOL_ENTRY_TYPE = registerSimple(Registries.LOOT_POOL_ENTRY_TYPE, registry -> LootPoolEntries.EMPTY); public static final Registry> LOOT_FUNCTION_TYPE = registerSimple( Registries.LOOT_FUNCTION_TYPE, registry -> LootItemFunctions.SET_COUNT ); public static final Registry LOOT_CONDITION_TYPE = registerSimple( Registries.LOOT_CONDITION_TYPE, registry -> LootItemConditions.INVERTED ); public static final Registry LOOT_NUMBER_PROVIDER_TYPE = registerSimple( Registries.LOOT_NUMBER_PROVIDER_TYPE, registry -> NumberProviders.CONSTANT ); public static final Registry LOOT_NBT_PROVIDER_TYPE = registerSimple(Registries.LOOT_NBT_PROVIDER_TYPE, registry -> NbtProviders.CONTEXT); public static final Registry LOOT_SCORE_PROVIDER_TYPE = registerSimple( Registries.LOOT_SCORE_PROVIDER_TYPE, registry -> ScoreboardNameProviders.CONTEXT ); public static final Registry> FLOAT_PROVIDER_TYPE = registerSimple(Registries.FLOAT_PROVIDER_TYPE, registry -> FloatProviderType.CONSTANT); public static final Registry> INT_PROVIDER_TYPE = registerSimple(Registries.INT_PROVIDER_TYPE, registry -> IntProviderType.CONSTANT); public static final Registry> HEIGHT_PROVIDER_TYPE = registerSimple( Registries.HEIGHT_PROVIDER_TYPE, registry -> HeightProviderType.CONSTANT ); public static final Registry> BLOCK_PREDICATE_TYPE = registerSimple(Registries.BLOCK_PREDICATE_TYPE, registry -> BlockPredicateType.NOT); public static final Registry> CARVER = registerSimple(Registries.CARVER, registry -> WorldCarver.CAVE); public static final Registry> FEATURE = registerSimple(Registries.FEATURE, registry -> Feature.ORE); public static final Registry> STRUCTURE_PLACEMENT = registerSimple( Registries.STRUCTURE_PLACEMENT, registry -> StructurePlacementType.RANDOM_SPREAD ); public static final Registry STRUCTURE_PIECE = registerSimple(Registries.STRUCTURE_PIECE, registry -> StructurePieceType.MINE_SHAFT_ROOM); public static final Registry> STRUCTURE_TYPE = registerSimple(Registries.STRUCTURE_TYPE, registry -> StructureType.JIGSAW); public static final Registry> PLACEMENT_MODIFIER_TYPE = registerSimple( Registries.PLACEMENT_MODIFIER_TYPE, registry -> PlacementModifierType.COUNT ); public static final Registry> BLOCKSTATE_PROVIDER_TYPE = registerSimple( Registries.BLOCK_STATE_PROVIDER_TYPE, registry -> BlockStateProviderType.SIMPLE_STATE_PROVIDER ); public static final Registry> FOLIAGE_PLACER_TYPE = registerSimple( Registries.FOLIAGE_PLACER_TYPE, registry -> FoliagePlacerType.BLOB_FOLIAGE_PLACER ); public static final Registry> TRUNK_PLACER_TYPE = registerSimple( Registries.TRUNK_PLACER_TYPE, registry -> TrunkPlacerType.STRAIGHT_TRUNK_PLACER ); public static final Registry> ROOT_PLACER_TYPE = registerSimple(Registries.ROOT_PLACER_TYPE, registry -> RootPlacerType.MANGROVE_ROOT_PLACER); public static final Registry> TREE_DECORATOR_TYPE = registerSimple( Registries.TREE_DECORATOR_TYPE, registry -> TreeDecoratorType.LEAVE_VINE ); public static final Registry> FEATURE_SIZE_TYPE = registerSimple( Registries.FEATURE_SIZE_TYPE, registry -> FeatureSizeType.TWO_LAYERS_FEATURE_SIZE ); public static final Registry> BIOME_SOURCE = registerSimple(Registries.BIOME_SOURCE, BiomeSources::bootstrap); public static final Registry> CHUNK_GENERATOR = registerSimple(Registries.CHUNK_GENERATOR, ChunkGenerators::bootstrap); public static final Registry> MATERIAL_CONDITION = registerSimple( Registries.MATERIAL_CONDITION, ConditionSource::bootstrap ); public static final Registry> MATERIAL_RULE = registerSimple(Registries.MATERIAL_RULE, RuleSource::bootstrap); public static final Registry> DENSITY_FUNCTION_TYPE = registerSimple( Registries.DENSITY_FUNCTION_TYPE, DensityFunctions::bootstrap ); public static final Registry> BLOCK_TYPE = registerSimple(Registries.BLOCK_TYPE, BlockTypes::bootstrap); public static final Registry> STRUCTURE_PROCESSOR = registerSimple( Registries.STRUCTURE_PROCESSOR, registry -> StructureProcessorType.BLOCK_IGNORE ); public static final Registry> STRUCTURE_POOL_ELEMENT = registerSimple( Registries.STRUCTURE_POOL_ELEMENT, registry -> StructurePoolElementType.EMPTY ); public static final Registry> POOL_ALIAS_BINDING_TYPE = registerSimple( Registries.POOL_ALIAS_BINDING, PoolAliasBindings::bootstrap ); public static final Registry DECORATED_POT_PATTERN = registerSimple(Registries.DECORATED_POT_PATTERN, DecoratedPotPatterns::bootstrap); public static final Registry CREATIVE_MODE_TAB = registerSimple(Registries.CREATIVE_MODE_TAB, CreativeModeTabs::bootstrap); public static final Registry> TRIGGER_TYPES = registerSimple(Registries.TRIGGER_TYPE, CriteriaTriggers::bootstrap); public static final Registry> NUMBER_FORMAT_TYPE = registerSimple(Registries.NUMBER_FORMAT_TYPE, NumberFormatTypes::bootstrap); public static final Registry> DATA_COMPONENT_TYPE = registerSimple(Registries.DATA_COMPONENT_TYPE, DataComponents::bootstrap); public static final Registry> ENTITY_SUB_PREDICATE_TYPE = registerSimple( Registries.ENTITY_SUB_PREDICATE_TYPE, EntitySubPredicates::bootstrap ); public static final Registry> DATA_COMPONENT_PREDICATE_TYPE = registerSimple( Registries.DATA_COMPONENT_PREDICATE_TYPE, DataComponentPredicates::bootstrap ); public static final Registry MAP_DECORATION_TYPE = registerSimple(Registries.MAP_DECORATION_TYPE, MapDecorationTypes::bootstrap); public static final Registry> ENCHANTMENT_EFFECT_COMPONENT_TYPE = registerSimple( Registries.ENCHANTMENT_EFFECT_COMPONENT_TYPE, EnchantmentEffectComponents::bootstrap ); public static final Registry> ENCHANTMENT_LEVEL_BASED_VALUE_TYPE = registerSimple( Registries.ENCHANTMENT_LEVEL_BASED_VALUE_TYPE, LevelBasedValue::bootstrap ); public static final Registry> ENCHANTMENT_ENTITY_EFFECT_TYPE = registerSimple( Registries.ENCHANTMENT_ENTITY_EFFECT_TYPE, EnchantmentEntityEffect::bootstrap ); public static final Registry> ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE = registerSimple( Registries.ENCHANTMENT_LOCATION_BASED_EFFECT_TYPE, EnchantmentLocationBasedEffect::bootstrap ); public static final Registry> ENCHANTMENT_VALUE_EFFECT_TYPE = registerSimple( Registries.ENCHANTMENT_VALUE_EFFECT_TYPE, EnchantmentValueEffect::bootstrap ); public static final Registry> ENCHANTMENT_PROVIDER_TYPE = registerSimple( Registries.ENCHANTMENT_PROVIDER_TYPE, EnchantmentProviderTypes::bootstrap ); public static final Registry> CONSUME_EFFECT_TYPE = registerSimple(Registries.CONSUME_EFFECT_TYPE, registry -> Type.APPLY_EFFECTS); public static final Registry> RECIPE_DISPLAY = registerSimple( Registries.RECIPE_DISPLAY, RecipeDisplays::bootstrap ); public static final Registry> SLOT_DISPLAY = registerSimple(Registries.SLOT_DISPLAY, SlotDisplays::bootstrap); public static final Registry RECIPE_BOOK_CATEGORY = registerSimple(Registries.RECIPE_BOOK_CATEGORY, RecipeBookCategories::bootstrap); public static final Registry TICKET_TYPE = registerSimple(Registries.TICKET_TYPE, registry -> TicketType.UNKNOWN); public static final Registry> TEST_ENVIRONMENT_DEFINITION_TYPE = registerSimple( Registries.TEST_ENVIRONMENT_DEFINITION_TYPE, TestEnvironmentDefinition::bootstrap ); public static final Registry> TEST_INSTANCE_TYPE = registerSimple( Registries.TEST_INSTANCE_TYPE, GameTestInstance::bootstrap ); public static final Registry> SPAWN_CONDITION_TYPE = registerSimple( Registries.SPAWN_CONDITION_TYPE, SpawnConditions::bootstrap ); public static final Registry> TEST_FUNCTION = registerSimple(Registries.TEST_FUNCTION, BuiltinTestFunctions::bootstrap); public static final Registry> REGISTRY = WRITABLE_REGISTRY; private static Registry registerSimple(ResourceKey> key, BuiltInRegistries.RegistryBootstrap bootstrap) { return internalRegister(key, new MappedRegistry<>(key, Lifecycle.stable(), false), bootstrap); } private static Registry registerSimpleWithIntrusiveHolders(ResourceKey> key, BuiltInRegistries.RegistryBootstrap bootstrap) { return internalRegister(key, new MappedRegistry<>(key, Lifecycle.stable(), true), bootstrap); } private static DefaultedRegistry registerDefaulted( ResourceKey> key, String defaultKey, BuiltInRegistries.RegistryBootstrap bootstrap ) { return internalRegister(key, new DefaultedMappedRegistry<>(defaultKey, key, Lifecycle.stable(), false), bootstrap); } private static DefaultedRegistry registerDefaultedWithIntrusiveHolders( ResourceKey> key, String defaultKey, BuiltInRegistries.RegistryBootstrap bootstrap ) { return internalRegister(key, new DefaultedMappedRegistry<>(defaultKey, key, Lifecycle.stable(), true), bootstrap); } private static > R internalRegister( ResourceKey> key, R registry, BuiltInRegistries.RegistryBootstrap bootstrap ) { Bootstrap.checkBootstrapCalled(() -> "registry " + key.location()); ResourceLocation resourceLocation = key.location(); LOADERS.put(resourceLocation, (Supplier)() -> bootstrap.run(registry)); WRITABLE_REGISTRY.register((ResourceKey>)key, registry, RegistrationInfo.BUILT_IN); return registry; } public static void bootStrap() { createContents(); freeze(); validate(REGISTRY); } private static void createContents() { LOADERS.forEach((resourceLocation, supplier) -> { if (supplier.get() == null) { LOGGER.error("Unable to bootstrap registry '{}'", resourceLocation); } }); } private static void freeze() { REGISTRY.freeze(); for (Registry registry : REGISTRY) { bindBootstrappedTagsToEmpty(registry); registry.freeze(); } } private static > void validate(Registry registry) { registry.forEach(registry2 -> { if (registry2.keySet().isEmpty()) { Util.logAndPauseIfInIde("Registry '" + registry.getKey((T)registry2) + "' was empty after loading"); } if (registry2 instanceof DefaultedRegistry) { ResourceLocation resourceLocation = ((DefaultedRegistry)registry2).getDefaultKey(); Validate.notNull(registry2.getValue(resourceLocation), "Missing default of DefaultedMappedRegistry: " + resourceLocation); } }); } public static HolderGetter acquireBootstrapRegistrationLookup(Registry registry) { return ((WritableRegistry)registry).createRegistrationLookup(); } private static void bindBootstrappedTagsToEmpty(Registry registry) { ((MappedRegistry)registry).bindAllTagsToEmpty(); } @FunctionalInterface interface RegistryBootstrap { Object run(Registry registry); } }