/* * Decompiled with CFR 0.152. */ package net.minecraft.data.worldgen.placement; import net.minecraft.core.Holder; import net.minecraft.core.HolderGetter; import net.minecraft.core.registries.Registries; import net.minecraft.data.worldgen.BootstrapContext; import net.minecraft.data.worldgen.features.PileFeatures; import net.minecraft.data.worldgen.features.TreeFeatures; import net.minecraft.data.worldgen.features.VegetationFeatures; import net.minecraft.data.worldgen.placement.PlacementUtils; import net.minecraft.resources.ResourceKey; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacementModifier; public class VillagePlacements { public static final ResourceKey PILE_HAY_VILLAGE = PlacementUtils.createKey("pile_hay"); public static final ResourceKey PILE_MELON_VILLAGE = PlacementUtils.createKey("pile_melon"); public static final ResourceKey PILE_SNOW_VILLAGE = PlacementUtils.createKey("pile_snow"); public static final ResourceKey PILE_ICE_VILLAGE = PlacementUtils.createKey("pile_ice"); public static final ResourceKey PILE_PUMPKIN_VILLAGE = PlacementUtils.createKey("pile_pumpkin"); public static final ResourceKey OAK_VILLAGE = PlacementUtils.createKey("oak"); public static final ResourceKey ACACIA_VILLAGE = PlacementUtils.createKey("acacia"); public static final ResourceKey SPRUCE_VILLAGE = PlacementUtils.createKey("spruce"); public static final ResourceKey PINE_VILLAGE = PlacementUtils.createKey("pine"); public static final ResourceKey PATCH_CACTUS_VILLAGE = PlacementUtils.createKey("patch_cactus"); public static final ResourceKey FLOWER_PLAIN_VILLAGE = PlacementUtils.createKey("flower_plain"); public static final ResourceKey PATCH_TAIGA_GRASS_VILLAGE = PlacementUtils.createKey("patch_taiga_grass"); public static final ResourceKey PATCH_BERRY_BUSH_VILLAGE = PlacementUtils.createKey("patch_berry_bush"); public static void bootstrap(BootstrapContext context) { HolderGetter> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); Holder.Reference> pileHay = configuredFeatures.getOrThrow(PileFeatures.PILE_HAY); Holder.Reference> pileMelon = configuredFeatures.getOrThrow(PileFeatures.PILE_MELON); Holder.Reference> pileSnow = configuredFeatures.getOrThrow(PileFeatures.PILE_SNOW); Holder.Reference> pileIce = configuredFeatures.getOrThrow(PileFeatures.PILE_ICE); Holder.Reference> pilePumpkin = configuredFeatures.getOrThrow(PileFeatures.PILE_PUMPKIN); Holder.Reference> oak = configuredFeatures.getOrThrow(TreeFeatures.OAK); Holder.Reference> acacia = configuredFeatures.getOrThrow(TreeFeatures.ACACIA); Holder.Reference> spruce = configuredFeatures.getOrThrow(TreeFeatures.SPRUCE); Holder.Reference> pine = configuredFeatures.getOrThrow(TreeFeatures.PINE); Holder.Reference> patchCactus = configuredFeatures.getOrThrow(VegetationFeatures.PATCH_CACTUS); Holder.Reference> flowerPlain = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_PLAIN); Holder.Reference> patchTaigaGrass = configuredFeatures.getOrThrow(VegetationFeatures.PATCH_TAIGA_GRASS); Holder.Reference> patchBerryBush = configuredFeatures.getOrThrow(VegetationFeatures.PATCH_BERRY_BUSH); PlacementUtils.register(context, PILE_HAY_VILLAGE, pileHay, new PlacementModifier[0]); PlacementUtils.register(context, PILE_MELON_VILLAGE, pileMelon, new PlacementModifier[0]); PlacementUtils.register(context, PILE_SNOW_VILLAGE, pileSnow, new PlacementModifier[0]); PlacementUtils.register(context, PILE_ICE_VILLAGE, pileIce, new PlacementModifier[0]); PlacementUtils.register(context, PILE_PUMPKIN_VILLAGE, pilePumpkin, new PlacementModifier[0]); PlacementUtils.register(context, OAK_VILLAGE, oak, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, ACACIA_VILLAGE, acacia, PlacementUtils.filteredByBlockSurvival(Blocks.ACACIA_SAPLING)); PlacementUtils.register(context, SPRUCE_VILLAGE, spruce, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, PINE_VILLAGE, pine, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, PATCH_CACTUS_VILLAGE, patchCactus, new PlacementModifier[0]); PlacementUtils.register(context, FLOWER_PLAIN_VILLAGE, flowerPlain, new PlacementModifier[0]); PlacementUtils.register(context, PATCH_TAIGA_GRASS_VILLAGE, patchTaigaGrass, new PlacementModifier[0]); PlacementUtils.register(context, PATCH_BERRY_BUSH_VILLAGE, patchBerryBush, new PlacementModifier[0]); } }