/* * Decompiled with CFR 0.152. */ package net.minecraft.data.worldgen.placement; import java.util.List; import net.minecraft.core.Direction; 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.TreeFeatures; 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.blockpredicates.BlockPredicate; import net.minecraft.world.level.levelgen.feature.ConfiguredFeature; import net.minecraft.world.level.levelgen.placement.BiomeFilter; import net.minecraft.world.level.levelgen.placement.BlockPredicateFilter; import net.minecraft.world.level.levelgen.placement.CountOnEveryLayerPlacement; import net.minecraft.world.level.levelgen.placement.EnvironmentScanPlacement; import net.minecraft.world.level.levelgen.placement.PlacedFeature; import net.minecraft.world.level.levelgen.placement.PlacementModifier; public class TreePlacements { public static final ResourceKey CRIMSON_FUNGI = PlacementUtils.createKey("crimson_fungi"); public static final ResourceKey WARPED_FUNGI = PlacementUtils.createKey("warped_fungi"); public static final ResourceKey OAK_CHECKED = PlacementUtils.createKey("oak_checked"); public static final ResourceKey DARK_OAK_CHECKED = PlacementUtils.createKey("dark_oak_checked"); public static final ResourceKey PALE_OAK_CHECKED = PlacementUtils.createKey("pale_oak_checked"); public static final ResourceKey PALE_OAK_CREAKING_CHECKED = PlacementUtils.createKey("pale_oak_creaking_checked"); public static final ResourceKey BIRCH_CHECKED = PlacementUtils.createKey("birch_checked"); public static final ResourceKey ACACIA_CHECKED = PlacementUtils.createKey("acacia_checked"); public static final ResourceKey SPRUCE_CHECKED = PlacementUtils.createKey("spruce_checked"); public static final ResourceKey MANGROVE_CHECKED = PlacementUtils.createKey("mangrove_checked"); public static final ResourceKey CHERRY_CHECKED = PlacementUtils.createKey("cherry_checked"); public static final ResourceKey PINE_ON_SNOW = PlacementUtils.createKey("pine_on_snow"); public static final ResourceKey SPRUCE_ON_SNOW = PlacementUtils.createKey("spruce_on_snow"); public static final ResourceKey PINE_CHECKED = PlacementUtils.createKey("pine_checked"); public static final ResourceKey JUNGLE_TREE_CHECKED = PlacementUtils.createKey("jungle_tree"); public static final ResourceKey FANCY_OAK_CHECKED = PlacementUtils.createKey("fancy_oak_checked"); public static final ResourceKey MEGA_JUNGLE_TREE_CHECKED = PlacementUtils.createKey("mega_jungle_tree_checked"); public static final ResourceKey MEGA_SPRUCE_CHECKED = PlacementUtils.createKey("mega_spruce_checked"); public static final ResourceKey MEGA_PINE_CHECKED = PlacementUtils.createKey("mega_pine_checked"); public static final ResourceKey TALL_MANGROVE_CHECKED = PlacementUtils.createKey("tall_mangrove_checked"); public static final ResourceKey JUNGLE_BUSH = PlacementUtils.createKey("jungle_bush"); public static final ResourceKey SUPER_BIRCH_BEES_0002 = PlacementUtils.createKey("super_birch_bees_0002"); public static final ResourceKey SUPER_BIRCH_BEES = PlacementUtils.createKey("super_birch_bees"); public static final ResourceKey OAK_BEES_0002_LEAF_LITTER = PlacementUtils.createKey("oak_bees_0002_leaf_litter"); public static final ResourceKey OAK_BEES_002 = PlacementUtils.createKey("oak_bees_002"); public static final ResourceKey BIRCH_BEES_0002_PLACED = PlacementUtils.createKey("birch_bees_0002"); public static final ResourceKey BIRCH_BEES_0002_LEAF_LITTER = PlacementUtils.createKey("birch_bees_0002_leaf_litter"); public static final ResourceKey BIRCH_BEES_002 = PlacementUtils.createKey("birch_bees_002"); public static final ResourceKey FANCY_OAK_BEES_0002_LEAF_LITTER = PlacementUtils.createKey("fancy_oak_bees_0002_leaf_litter"); public static final ResourceKey FANCY_OAK_BEES_002 = PlacementUtils.createKey("fancy_oak_bees_002"); public static final ResourceKey FANCY_OAK_BEES = PlacementUtils.createKey("fancy_oak_bees"); public static final ResourceKey CHERRY_BEES_005 = PlacementUtils.createKey("cherry_bees_005"); public static final ResourceKey OAK_LEAF_LITTER = PlacementUtils.createKey("oak_leaf_litter"); public static final ResourceKey DARK_OAK_LEAF_LITTER = PlacementUtils.createKey("dark_oak_leaf_litter"); public static final ResourceKey BIRCH_LEAF_LITTER = PlacementUtils.createKey("birch_leaf_litter"); public static final ResourceKey FANCY_OAK_LEAF_LITTER = PlacementUtils.createKey("fancy_oak_leaf_litter"); public static final ResourceKey FALLEN_OAK_TREE = PlacementUtils.createKey("fallen_oak_tree"); public static final ResourceKey FALLEN_BIRCH_TREE = PlacementUtils.createKey("fallen_birch_tree"); public static final ResourceKey FALLEN_SUPER_BIRCH_TREE = PlacementUtils.createKey("fallen_super_birch_tree"); public static final ResourceKey FALLEN_SPRUCE_TREE = PlacementUtils.createKey("fallen_spruce_tree"); public static final ResourceKey FALLEN_JUNGLE_TREE = PlacementUtils.createKey("fallen_jungle_tree"); public static void bootstrap(BootstrapContext context) { HolderGetter> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); Holder.Reference> crimsonFungus = configuredFeatures.getOrThrow(TreeFeatures.CRIMSON_FUNGUS); Holder.Reference> warpedFungus = configuredFeatures.getOrThrow(TreeFeatures.WARPED_FUNGUS); Holder.Reference> oak = configuredFeatures.getOrThrow(TreeFeatures.OAK); Holder.Reference> darkOak = configuredFeatures.getOrThrow(TreeFeatures.DARK_OAK); Holder.Reference> paleOak = configuredFeatures.getOrThrow(TreeFeatures.PALE_OAK); Holder.Reference> paleOakCreaking = configuredFeatures.getOrThrow(TreeFeatures.PALE_OAK_CREAKING); Holder.Reference> birch = configuredFeatures.getOrThrow(TreeFeatures.BIRCH); Holder.Reference> acacia = configuredFeatures.getOrThrow(TreeFeatures.ACACIA); Holder.Reference> spruce = configuredFeatures.getOrThrow(TreeFeatures.SPRUCE); Holder.Reference> mangrove = configuredFeatures.getOrThrow(TreeFeatures.MANGROVE); Holder.Reference> cherry = configuredFeatures.getOrThrow(TreeFeatures.CHERRY); Holder.Reference> pine = configuredFeatures.getOrThrow(TreeFeatures.PINE); Holder.Reference> jungleTree = configuredFeatures.getOrThrow(TreeFeatures.JUNGLE_TREE); Holder.Reference> fancyOak = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK); Holder.Reference> megaJungleTree = configuredFeatures.getOrThrow(TreeFeatures.MEGA_JUNGLE_TREE); Holder.Reference> megaSpruce = configuredFeatures.getOrThrow(TreeFeatures.MEGA_SPRUCE); Holder.Reference> megaPine = configuredFeatures.getOrThrow(TreeFeatures.MEGA_PINE); Holder.Reference> tallMangrove = configuredFeatures.getOrThrow(TreeFeatures.TALL_MANGROVE); Holder.Reference> jungleBush = configuredFeatures.getOrThrow(TreeFeatures.JUNGLE_BUSH); Holder.Reference> superBirchBees0002 = configuredFeatures.getOrThrow(TreeFeatures.SUPER_BIRCH_BEES_0002); Holder.Reference> superBirchBees = configuredFeatures.getOrThrow(TreeFeatures.SUPER_BIRCH_BEES); Holder.Reference> oakBees0002LeafLitter = configuredFeatures.getOrThrow(TreeFeatures.OAK_BEES_0002_LEAF_LITTER); Holder.Reference> oakBees002 = configuredFeatures.getOrThrow(TreeFeatures.OAK_BEES_002); Holder.Reference> birchBees0002 = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_BEES_0002); Holder.Reference> birchBees0002LeafLitter = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_BEES_0002_LEAF_LITTER); Holder.Reference> birchBees002 = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_BEES_002); Holder.Reference> fancyOakBees0002LeafLitter = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_BEES_0002_LEAF_LITTER); Holder.Reference> fancyOakBees002 = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_BEES_002); Holder.Reference> fancyOakBees = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_BEES); Holder.Reference> cherryBees005 = configuredFeatures.getOrThrow(TreeFeatures.CHERRY_BEES_005); Holder.Reference> oakLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.OAK_LEAF_LITTER); Holder.Reference> darkOakLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.DARK_OAK_LEAF_LITTER); Holder.Reference> birchLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_LEAF_LITTER); Holder.Reference> fancyOakLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_LEAF_LITTER); Holder.Reference> fallenOakTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_OAK_TREE); Holder.Reference> fallenBirchTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_BIRCH_TREE); Holder.Reference> fallenSuperBirchTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_SUPER_BIRCH_TREE); Holder.Reference> fallenSpruceTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_SPRUCE_TREE); Holder.Reference> fallenJungleTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_JUNGLE_TREE); PlacementUtils.register(context, CRIMSON_FUNGI, crimsonFungus, CountOnEveryLayerPlacement.of(8), BiomeFilter.biome()); PlacementUtils.register(context, WARPED_FUNGI, warpedFungus, CountOnEveryLayerPlacement.of(8), BiomeFilter.biome()); PlacementUtils.register(context, OAK_CHECKED, oak, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, DARK_OAK_CHECKED, darkOak, PlacementUtils.filteredByBlockSurvival(Blocks.DARK_OAK_SAPLING)); PlacementUtils.register(context, PALE_OAK_CHECKED, paleOak, PlacementUtils.filteredByBlockSurvival(Blocks.PALE_OAK_SAPLING)); PlacementUtils.register(context, PALE_OAK_CREAKING_CHECKED, paleOakCreaking, PlacementUtils.filteredByBlockSurvival(Blocks.PALE_OAK_SAPLING)); PlacementUtils.register(context, BIRCH_CHECKED, birch, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, ACACIA_CHECKED, acacia, PlacementUtils.filteredByBlockSurvival(Blocks.ACACIA_SAPLING)); PlacementUtils.register(context, SPRUCE_CHECKED, spruce, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, MANGROVE_CHECKED, mangrove, PlacementUtils.filteredByBlockSurvival(Blocks.MANGROVE_PROPAGULE)); PlacementUtils.register(context, CHERRY_CHECKED, cherry, PlacementUtils.filteredByBlockSurvival(Blocks.CHERRY_SAPLING)); BlockPredicate snowTreePredicate = BlockPredicate.matchesBlocks(Direction.DOWN.getUnitVec3i(), Blocks.SNOW_BLOCK, Blocks.POWDER_SNOW); List snowTreeFilterDecorator = List.of(EnvironmentScanPlacement.scanningFor(Direction.UP, BlockPredicate.not(BlockPredicate.matchesBlocks(Blocks.POWDER_SNOW)), 8), BlockPredicateFilter.forPredicate(snowTreePredicate)); PlacementUtils.register(context, PINE_ON_SNOW, pine, snowTreeFilterDecorator); PlacementUtils.register(context, SPRUCE_ON_SNOW, spruce, snowTreeFilterDecorator); PlacementUtils.register(context, PINE_CHECKED, pine, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, JUNGLE_TREE_CHECKED, jungleTree, PlacementUtils.filteredByBlockSurvival(Blocks.JUNGLE_SAPLING)); PlacementUtils.register(context, FANCY_OAK_CHECKED, fancyOak, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, MEGA_JUNGLE_TREE_CHECKED, megaJungleTree, PlacementUtils.filteredByBlockSurvival(Blocks.JUNGLE_SAPLING)); PlacementUtils.register(context, MEGA_SPRUCE_CHECKED, megaSpruce, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, MEGA_PINE_CHECKED, megaPine, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, TALL_MANGROVE_CHECKED, tallMangrove, PlacementUtils.filteredByBlockSurvival(Blocks.MANGROVE_PROPAGULE)); PlacementUtils.register(context, JUNGLE_BUSH, jungleBush, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, SUPER_BIRCH_BEES_0002, superBirchBees0002, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, SUPER_BIRCH_BEES, superBirchBees, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, OAK_BEES_0002_LEAF_LITTER, oakBees0002LeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, OAK_BEES_002, oakBees002, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, BIRCH_BEES_0002_PLACED, birchBees0002, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, BIRCH_BEES_0002_LEAF_LITTER, birchBees0002LeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, BIRCH_BEES_002, birchBees002, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, FANCY_OAK_BEES_0002_LEAF_LITTER, fancyOakBees0002LeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, FANCY_OAK_BEES_002, fancyOakBees002, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, FANCY_OAK_BEES, fancyOakBees, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, CHERRY_BEES_005, cherryBees005, PlacementUtils.filteredByBlockSurvival(Blocks.CHERRY_SAPLING)); PlacementUtils.register(context, OAK_LEAF_LITTER, oakLeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, DARK_OAK_LEAF_LITTER, darkOakLeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.DARK_OAK_SAPLING)); PlacementUtils.register(context, BIRCH_LEAF_LITTER, birchLeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, FANCY_OAK_LEAF_LITTER, fancyOakLeafLitter, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, FALLEN_OAK_TREE, fallenOakTree, PlacementUtils.filteredByBlockSurvival(Blocks.OAK_SAPLING)); PlacementUtils.register(context, FALLEN_BIRCH_TREE, fallenBirchTree, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, FALLEN_SUPER_BIRCH_TREE, fallenSuperBirchTree, PlacementUtils.filteredByBlockSurvival(Blocks.BIRCH_SAPLING)); PlacementUtils.register(context, FALLEN_SPRUCE_TREE, fallenSpruceTree, PlacementUtils.filteredByBlockSurvival(Blocks.SPRUCE_SAPLING)); PlacementUtils.register(context, FALLEN_JUNGLE_TREE, fallenJungleTree, PlacementUtils.filteredByBlockSurvival(Blocks.JUNGLE_SAPLING)); } }