155 lines
17 KiB
Java
155 lines
17 KiB
Java
/*
|
|
* 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<PlacedFeature> CRIMSON_FUNGI = PlacementUtils.createKey("crimson_fungi");
|
|
public static final ResourceKey<PlacedFeature> WARPED_FUNGI = PlacementUtils.createKey("warped_fungi");
|
|
public static final ResourceKey<PlacedFeature> OAK_CHECKED = PlacementUtils.createKey("oak_checked");
|
|
public static final ResourceKey<PlacedFeature> DARK_OAK_CHECKED = PlacementUtils.createKey("dark_oak_checked");
|
|
public static final ResourceKey<PlacedFeature> PALE_OAK_CHECKED = PlacementUtils.createKey("pale_oak_checked");
|
|
public static final ResourceKey<PlacedFeature> PALE_OAK_CREAKING_CHECKED = PlacementUtils.createKey("pale_oak_creaking_checked");
|
|
public static final ResourceKey<PlacedFeature> BIRCH_CHECKED = PlacementUtils.createKey("birch_checked");
|
|
public static final ResourceKey<PlacedFeature> ACACIA_CHECKED = PlacementUtils.createKey("acacia_checked");
|
|
public static final ResourceKey<PlacedFeature> SPRUCE_CHECKED = PlacementUtils.createKey("spruce_checked");
|
|
public static final ResourceKey<PlacedFeature> MANGROVE_CHECKED = PlacementUtils.createKey("mangrove_checked");
|
|
public static final ResourceKey<PlacedFeature> CHERRY_CHECKED = PlacementUtils.createKey("cherry_checked");
|
|
public static final ResourceKey<PlacedFeature> PINE_ON_SNOW = PlacementUtils.createKey("pine_on_snow");
|
|
public static final ResourceKey<PlacedFeature> SPRUCE_ON_SNOW = PlacementUtils.createKey("spruce_on_snow");
|
|
public static final ResourceKey<PlacedFeature> PINE_CHECKED = PlacementUtils.createKey("pine_checked");
|
|
public static final ResourceKey<PlacedFeature> JUNGLE_TREE_CHECKED = PlacementUtils.createKey("jungle_tree");
|
|
public static final ResourceKey<PlacedFeature> FANCY_OAK_CHECKED = PlacementUtils.createKey("fancy_oak_checked");
|
|
public static final ResourceKey<PlacedFeature> MEGA_JUNGLE_TREE_CHECKED = PlacementUtils.createKey("mega_jungle_tree_checked");
|
|
public static final ResourceKey<PlacedFeature> MEGA_SPRUCE_CHECKED = PlacementUtils.createKey("mega_spruce_checked");
|
|
public static final ResourceKey<PlacedFeature> MEGA_PINE_CHECKED = PlacementUtils.createKey("mega_pine_checked");
|
|
public static final ResourceKey<PlacedFeature> TALL_MANGROVE_CHECKED = PlacementUtils.createKey("tall_mangrove_checked");
|
|
public static final ResourceKey<PlacedFeature> JUNGLE_BUSH = PlacementUtils.createKey("jungle_bush");
|
|
public static final ResourceKey<PlacedFeature> SUPER_BIRCH_BEES_0002 = PlacementUtils.createKey("super_birch_bees_0002");
|
|
public static final ResourceKey<PlacedFeature> SUPER_BIRCH_BEES = PlacementUtils.createKey("super_birch_bees");
|
|
public static final ResourceKey<PlacedFeature> OAK_BEES_0002_LEAF_LITTER = PlacementUtils.createKey("oak_bees_0002_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> OAK_BEES_002 = PlacementUtils.createKey("oak_bees_002");
|
|
public static final ResourceKey<PlacedFeature> BIRCH_BEES_0002_PLACED = PlacementUtils.createKey("birch_bees_0002");
|
|
public static final ResourceKey<PlacedFeature> BIRCH_BEES_0002_LEAF_LITTER = PlacementUtils.createKey("birch_bees_0002_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> BIRCH_BEES_002 = PlacementUtils.createKey("birch_bees_002");
|
|
public static final ResourceKey<PlacedFeature> FANCY_OAK_BEES_0002_LEAF_LITTER = PlacementUtils.createKey("fancy_oak_bees_0002_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> FANCY_OAK_BEES_002 = PlacementUtils.createKey("fancy_oak_bees_002");
|
|
public static final ResourceKey<PlacedFeature> FANCY_OAK_BEES = PlacementUtils.createKey("fancy_oak_bees");
|
|
public static final ResourceKey<PlacedFeature> CHERRY_BEES_005 = PlacementUtils.createKey("cherry_bees_005");
|
|
public static final ResourceKey<PlacedFeature> OAK_LEAF_LITTER = PlacementUtils.createKey("oak_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> DARK_OAK_LEAF_LITTER = PlacementUtils.createKey("dark_oak_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> BIRCH_LEAF_LITTER = PlacementUtils.createKey("birch_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> FANCY_OAK_LEAF_LITTER = PlacementUtils.createKey("fancy_oak_leaf_litter");
|
|
public static final ResourceKey<PlacedFeature> FALLEN_OAK_TREE = PlacementUtils.createKey("fallen_oak_tree");
|
|
public static final ResourceKey<PlacedFeature> FALLEN_BIRCH_TREE = PlacementUtils.createKey("fallen_birch_tree");
|
|
public static final ResourceKey<PlacedFeature> FALLEN_SUPER_BIRCH_TREE = PlacementUtils.createKey("fallen_super_birch_tree");
|
|
public static final ResourceKey<PlacedFeature> FALLEN_SPRUCE_TREE = PlacementUtils.createKey("fallen_spruce_tree");
|
|
public static final ResourceKey<PlacedFeature> FALLEN_JUNGLE_TREE = PlacementUtils.createKey("fallen_jungle_tree");
|
|
|
|
public static void bootstrap(BootstrapContext<PlacedFeature> context) {
|
|
HolderGetter<ConfiguredFeature<?, ?>> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> crimsonFungus = configuredFeatures.getOrThrow(TreeFeatures.CRIMSON_FUNGUS);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> warpedFungus = configuredFeatures.getOrThrow(TreeFeatures.WARPED_FUNGUS);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> oak = configuredFeatures.getOrThrow(TreeFeatures.OAK);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> darkOak = configuredFeatures.getOrThrow(TreeFeatures.DARK_OAK);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> paleOak = configuredFeatures.getOrThrow(TreeFeatures.PALE_OAK);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> paleOakCreaking = configuredFeatures.getOrThrow(TreeFeatures.PALE_OAK_CREAKING);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> birch = configuredFeatures.getOrThrow(TreeFeatures.BIRCH);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> acacia = configuredFeatures.getOrThrow(TreeFeatures.ACACIA);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> spruce = configuredFeatures.getOrThrow(TreeFeatures.SPRUCE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> mangrove = configuredFeatures.getOrThrow(TreeFeatures.MANGROVE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> cherry = configuredFeatures.getOrThrow(TreeFeatures.CHERRY);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> pine = configuredFeatures.getOrThrow(TreeFeatures.PINE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> jungleTree = configuredFeatures.getOrThrow(TreeFeatures.JUNGLE_TREE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fancyOak = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> megaJungleTree = configuredFeatures.getOrThrow(TreeFeatures.MEGA_JUNGLE_TREE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> megaSpruce = configuredFeatures.getOrThrow(TreeFeatures.MEGA_SPRUCE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> megaPine = configuredFeatures.getOrThrow(TreeFeatures.MEGA_PINE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> tallMangrove = configuredFeatures.getOrThrow(TreeFeatures.TALL_MANGROVE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> jungleBush = configuredFeatures.getOrThrow(TreeFeatures.JUNGLE_BUSH);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> superBirchBees0002 = configuredFeatures.getOrThrow(TreeFeatures.SUPER_BIRCH_BEES_0002);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> superBirchBees = configuredFeatures.getOrThrow(TreeFeatures.SUPER_BIRCH_BEES);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> oakBees0002LeafLitter = configuredFeatures.getOrThrow(TreeFeatures.OAK_BEES_0002_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> oakBees002 = configuredFeatures.getOrThrow(TreeFeatures.OAK_BEES_002);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> birchBees0002 = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_BEES_0002);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> birchBees0002LeafLitter = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_BEES_0002_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> birchBees002 = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_BEES_002);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fancyOakBees0002LeafLitter = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_BEES_0002_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fancyOakBees002 = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_BEES_002);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fancyOakBees = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_BEES);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> cherryBees005 = configuredFeatures.getOrThrow(TreeFeatures.CHERRY_BEES_005);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> oakLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.OAK_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> darkOakLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.DARK_OAK_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> birchLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.BIRCH_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fancyOakLeafLitter = configuredFeatures.getOrThrow(TreeFeatures.FANCY_OAK_LEAF_LITTER);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fallenOakTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_OAK_TREE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fallenBirchTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_BIRCH_TREE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fallenSuperBirchTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_SUPER_BIRCH_TREE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> fallenSpruceTree = configuredFeatures.getOrThrow(TreeFeatures.FALLEN_SPRUCE_TREE);
|
|
Holder.Reference<ConfiguredFeature<?, ?>> 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<PlacementModifier> 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));
|
|
}
|
|
}
|
|
|