| 1 | package net.minecraft.data.worldgen.placement;
|
| 2 |
|
| 3 | import com.google.common.collect.ImmutableList;
|
| 4 | import com.google.common.collect.ImmutableList.Builder;
|
| 5 | import java.util.List;
|
| 6 | import net.minecraft.core.Direction;
|
| 7 | import net.minecraft.core.Holder;
|
| 8 | import net.minecraft.core.HolderGetter;
|
| 9 | import net.minecraft.core.registries.Registries;
|
| 10 | import net.minecraft.data.worldgen.BootstrapContext;
|
| 11 | import net.minecraft.data.worldgen.features.TreeFeatures;
|
| 12 | import net.minecraft.data.worldgen.features.VegetationFeatures;
|
| 13 | import net.minecraft.resources.ResourceKey;
|
| 14 | import net.minecraft.util.Util;
|
| 15 | import net.minecraft.util.valueproviders.ClampedInt;
|
| 16 | import net.minecraft.util.valueproviders.UniformInt;
|
| 17 | import net.minecraft.world.level.block.Block;
|
| 18 | import net.minecraft.world.level.block.Blocks;
|
| 19 | import net.minecraft.world.level.levelgen.VerticalAnchor;
|
| 20 | import net.minecraft.world.level.levelgen.blockpredicates.BlockPredicate;
|
| 21 | import net.minecraft.world.level.levelgen.feature.Feature;
|
| 22 | import net.minecraft.world.level.levelgen.placement.BiomeFilter;
|
| 23 | import net.minecraft.world.level.levelgen.placement.BlockPredicateFilter;
|
| 24 | import net.minecraft.world.level.levelgen.placement.CountPlacement;
|
| 25 | import net.minecraft.world.level.levelgen.placement.HeightRangePlacement;
|
| 26 | import net.minecraft.world.level.levelgen.placement.InSquarePlacement;
|
| 27 | import net.minecraft.world.level.levelgen.placement.NoiseBasedCountPlacement;
|
| 28 | import net.minecraft.world.level.levelgen.placement.NoiseThresholdCountPlacement;
|
| 29 | import net.minecraft.world.level.levelgen.placement.OffsetPlacement;
|
| 30 | import net.minecraft.world.level.levelgen.placement.PlacedFeature;
|
| 31 | import net.minecraft.world.level.levelgen.placement.PlacementModifier;
|
| 32 | import net.minecraft.world.level.levelgen.placement.RarityFilter;
|
| 33 | import net.minecraft.world.level.levelgen.placement.SurfaceWaterDepthFilter;
|
| 34 | import org.jspecify.annotations.Nullable;
|
| 35 |
|
| 36 | public class VegetationPlacements {
|
| 37 | public static final ResourceKey<PlacedFeature> BAMBOO_LIGHT = PlacementUtils.createKey("bamboo_light");
|
| 38 | public static final ResourceKey<PlacedFeature> BAMBOO = PlacementUtils.createKey("bamboo");
|
| 39 | public static final ResourceKey<PlacedFeature> BAMBOO_IN_STRUCTURE = PlacementUtils.createKey("bamboo_in_structure");
|
| 40 | public static final ResourceKey<PlacedFeature> VINES = PlacementUtils.createKey("vines");
|
| 41 | public static final ResourceKey<PlacedFeature> PATCH_SUNFLOWER = PlacementUtils.createKey("patch_sunflower");
|
| 42 | public static final ResourceKey<PlacedFeature> PATCH_PUMPKIN = PlacementUtils.createKey("patch_pumpkin");
|
| 43 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_PLAIN = PlacementUtils.createKey("patch_grass_plain");
|
| 44 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_MEADOW = PlacementUtils.createKey("patch_grass_meadow");
|
| 45 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_FOREST = PlacementUtils.createKey("patch_grass_forest");
|
| 46 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_BADLANDS = PlacementUtils.createKey("patch_grass_badlands");
|
| 47 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_SAVANNA = PlacementUtils.createKey("patch_grass_savanna");
|
| 48 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_NORMAL = PlacementUtils.createKey("patch_grass_normal");
|
| 49 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_TAIGA_2 = PlacementUtils.createKey("patch_grass_taiga_2");
|
| 50 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_TAIGA = PlacementUtils.createKey("patch_grass_taiga");
|
| 51 | public static final ResourceKey<PlacedFeature> PATCH_GRASS_JUNGLE = PlacementUtils.createKey("patch_grass_jungle");
|
| 52 | public static final ResourceKey<PlacedFeature> GRASS_BONEMEAL = PlacementUtils.createKey("grass_bonemeal");
|
| 53 | public static final ResourceKey<PlacedFeature> PATCH_DEAD_BUSH_2 = PlacementUtils.createKey("patch_dead_bush_2");
|
| 54 | public static final ResourceKey<PlacedFeature> PATCH_DEAD_BUSH = PlacementUtils.createKey("patch_dead_bush");
|
| 55 | public static final ResourceKey<PlacedFeature> PATCH_DEAD_BUSH_BADLANDS = PlacementUtils.createKey("patch_dead_bush_badlands");
|
| 56 | public static final ResourceKey<PlacedFeature> PATCH_DRY_GRASS_BADLANDS = PlacementUtils.createKey("patch_dry_grass_badlands");
|
| 57 | public static final ResourceKey<PlacedFeature> PATCH_DRY_GRASS_DESERT = PlacementUtils.createKey("patch_dry_grass_desert");
|
| 58 | public static final ResourceKey<PlacedFeature> PATCH_MELON = PlacementUtils.createKey("patch_melon");
|
| 59 | public static final ResourceKey<PlacedFeature> PATCH_MELON_SPARSE = PlacementUtils.createKey("patch_melon_sparse");
|
| 60 | public static final ResourceKey<PlacedFeature> PATCH_BERRY_COMMON = PlacementUtils.createKey("patch_berry_common");
|
| 61 | public static final ResourceKey<PlacedFeature> PATCH_BERRY_RARE = PlacementUtils.createKey("patch_berry_rare");
|
| 62 | public static final ResourceKey<PlacedFeature> PATCH_WATERLILY = PlacementUtils.createKey("patch_waterlily");
|
| 63 | public static final ResourceKey<PlacedFeature> PATCH_TALL_GRASS_2 = PlacementUtils.createKey("patch_tall_grass_2");
|
| 64 | public static final ResourceKey<PlacedFeature> PATCH_TALL_GRASS = PlacementUtils.createKey("patch_tall_grass");
|
| 65 | public static final ResourceKey<PlacedFeature> PATCH_LARGE_FERN = PlacementUtils.createKey("patch_large_fern");
|
| 66 | public static final ResourceKey<PlacedFeature> PATCH_BUSH = PlacementUtils.createKey("patch_bush");
|
| 67 | public static final ResourceKey<PlacedFeature> PATCH_RED_SHRUB = PlacementUtils.createKey("patch_red_shrub");
|
| 68 | public static final ResourceKey<PlacedFeature> PATCH_LEAF_LITTER = PlacementUtils.createKey("patch_leaf_litter");
|
| 69 | public static final ResourceKey<PlacedFeature> PATCH_CACTUS_DESERT = PlacementUtils.createKey("patch_cactus_desert");
|
| 70 | public static final ResourceKey<PlacedFeature> PATCH_CACTUS_DECORATED = PlacementUtils.createKey("patch_cactus_decorated");
|
| 71 | public static final ResourceKey<PlacedFeature> PATCH_SUGAR_CANE_SWAMP = PlacementUtils.createKey("patch_sugar_cane_swamp");
|
| 72 | public static final ResourceKey<PlacedFeature> PATCH_SUGAR_CANE_DESERT = PlacementUtils.createKey("patch_sugar_cane_desert");
|
| 73 | public static final ResourceKey<PlacedFeature> PATCH_SUGAR_CANE_BADLANDS = PlacementUtils.createKey("patch_sugar_cane_badlands");
|
| 74 | public static final ResourceKey<PlacedFeature> PATCH_SUGAR_CANE = PlacementUtils.createKey("patch_sugar_cane");
|
| 75 | public static final ResourceKey<PlacedFeature> PATCH_FIREFLY_BUSH_SWAMP = PlacementUtils.createKey("patch_firefly_bush_swamp");
|
| 76 | public static final ResourceKey<PlacedFeature> PATCH_FIREFLY_BUSH_NEAR_WATER_SWAMP = PlacementUtils.createKey("patch_firefly_bush_near_water_swamp");
|
| 77 | public static final ResourceKey<PlacedFeature> PATCH_FIREFLY_BUSH_NEAR_WATER = PlacementUtils.createKey("patch_firefly_bush_near_water");
|
| 78 | public static final ResourceKey<PlacedFeature> BROWN_MUSHROOM_NETHER = PlacementUtils.createKey("brown_mushroom_nether");
|
| 79 | public static final ResourceKey<PlacedFeature> RED_MUSHROOM_NETHER = PlacementUtils.createKey("red_mushroom_nether");
|
| 80 | public static final ResourceKey<PlacedFeature> BROWN_MUSHROOM_NORMAL = PlacementUtils.createKey("brown_mushroom_normal");
|
| 81 | public static final ResourceKey<PlacedFeature> RED_MUSHROOM_NORMAL = PlacementUtils.createKey("red_mushroom_normal");
|
| 82 | public static final ResourceKey<PlacedFeature> BROWN_MUSHROOM_TAIGA = PlacementUtils.createKey("brown_mushroom_taiga");
|
| 83 | public static final ResourceKey<PlacedFeature> RED_MUSHROOM_TAIGA = PlacementUtils.createKey("red_mushroom_taiga");
|
| 84 | public static final ResourceKey<PlacedFeature> BROWN_MUSHROOM_OLD_GROWTH = PlacementUtils.createKey("brown_mushroom_old_growth");
|
| 85 | public static final ResourceKey<PlacedFeature> RED_MUSHROOM_OLD_GROWTH = PlacementUtils.createKey("red_mushroom_old_growth");
|
| 86 | public static final ResourceKey<PlacedFeature> BROWN_MUSHROOM_SWAMP = PlacementUtils.createKey("brown_mushroom_swamp");
|
| 87 | public static final ResourceKey<PlacedFeature> RED_MUSHROOM_SWAMP = PlacementUtils.createKey("red_mushroom_swamp");
|
| 88 | public static final ResourceKey<PlacedFeature> BROWN_MUSHROOM_DAPPLED_FOREST = PlacementUtils.createKey("brown_mushroom_dappled_forest");
|
| 89 | public static final ResourceKey<PlacedFeature> FLOWER_WARM = PlacementUtils.createKey("flower_warm");
|
| 90 | public static final ResourceKey<PlacedFeature> FLOWER_DEFAULT = PlacementUtils.createKey("flower_default");
|
| 91 | public static final ResourceKey<PlacedFeature> FLOWER_FLOWER_FOREST = PlacementUtils.createKey("flower_flower_forest");
|
| 92 | public static final ResourceKey<PlacedFeature> FLOWER_SWAMP = PlacementUtils.createKey("flower_swamp");
|
| 93 | public static final ResourceKey<PlacedFeature> FLOWER_PLAINS = PlacementUtils.createKey("flower_plains");
|
| 94 | public static final ResourceKey<PlacedFeature> FLOWER_MEADOW = PlacementUtils.createKey("flower_meadow");
|
| 95 | public static final ResourceKey<PlacedFeature> FLOWER_CHERRY = PlacementUtils.createKey("flower_cherry");
|
| 96 | public static final ResourceKey<PlacedFeature> FLOWER_PALE_GARDEN = PlacementUtils.createKey("flower_pale_garden");
|
| 97 | public static final ResourceKey<PlacedFeature> WILDFLOWERS_BIRCH_FOREST = PlacementUtils.createKey("wildflowers_birch_forest");
|
| 98 | public static final ResourceKey<PlacedFeature> WILDFLOWERS_MEADOW = PlacementUtils.createKey("wildflowers_meadow");
|
| 99 | public static final ResourceKey<PlacedFeature> TREES_PLAINS = PlacementUtils.createKey("trees_plains");
|
| 100 | public static final ResourceKey<PlacedFeature> DARK_FOREST_VEGETATION = PlacementUtils.createKey("dark_forest_vegetation");
|
| 101 | public static final ResourceKey<PlacedFeature> PALE_GARDEN_VEGETATION = PlacementUtils.createKey("pale_garden_vegetation");
|
| 102 | public static final ResourceKey<PlacedFeature> FLOWER_FOREST_FLOWERS = PlacementUtils.createKey("flower_forest_flowers");
|
| 103 | public static final ResourceKey<PlacedFeature> FOREST_FLOWERS = PlacementUtils.createKey("forest_flowers");
|
| 104 | public static final ResourceKey<PlacedFeature> PALE_GARDEN_FLOWERS = PlacementUtils.createKey("pale_garden_flowers");
|
| 105 | public static final ResourceKey<PlacedFeature> PALE_MOSS_PATCH = PlacementUtils.createKey("pale_moss_patch");
|
| 106 | public static final ResourceKey<PlacedFeature> TREES_FLOWER_FOREST = PlacementUtils.createKey("trees_flower_forest");
|
| 107 | public static final ResourceKey<PlacedFeature> TREES_MEADOW = PlacementUtils.createKey("trees_meadow");
|
| 108 | public static final ResourceKey<PlacedFeature> TREES_CHERRY = PlacementUtils.createKey("trees_cherry");
|
| 109 | public static final ResourceKey<PlacedFeature> TREES_TAIGA = PlacementUtils.createKey("trees_taiga");
|
| 110 | public static final ResourceKey<PlacedFeature> TREES_GROVE = PlacementUtils.createKey("trees_grove");
|
| 111 | public static final ResourceKey<PlacedFeature> TREES_BADLANDS = PlacementUtils.createKey("trees_badlands");
|
| 112 | public static final ResourceKey<PlacedFeature> TREES_SNOWY = PlacementUtils.createKey("trees_snowy");
|
| 113 | public static final ResourceKey<PlacedFeature> TREES_SWAMP = PlacementUtils.createKey("trees_swamp");
|
| 114 | public static final ResourceKey<PlacedFeature> TREES_WINDSWEPT_SAVANNA = PlacementUtils.createKey("trees_windswept_savanna");
|
| 115 | public static final ResourceKey<PlacedFeature> TREES_SAVANNA = PlacementUtils.createKey("trees_savanna");
|
| 116 | public static final ResourceKey<PlacedFeature> BIRCH_TALL = PlacementUtils.createKey("birch_tall");
|
| 117 | public static final ResourceKey<PlacedFeature> TREES_BIRCH = PlacementUtils.createKey("trees_birch");
|
| 118 | public static final ResourceKey<PlacedFeature> TREES_WINDSWEPT_FOREST = PlacementUtils.createKey("trees_windswept_forest");
|
| 119 | public static final ResourceKey<PlacedFeature> TREES_WINDSWEPT_HILLS = PlacementUtils.createKey("trees_windswept_hills");
|
| 120 | public static final ResourceKey<PlacedFeature> TREES_WATER = PlacementUtils.createKey("trees_water");
|
| 121 | public static final ResourceKey<PlacedFeature> TREES_BIRCH_AND_OAK_LEAF_LITTER = PlacementUtils.createKey("trees_birch_and_oak_leaf_litter");
|
| 122 | public static final ResourceKey<PlacedFeature> TREES_SPARSE_JUNGLE = PlacementUtils.createKey("trees_sparse_jungle");
|
| 123 | public static final ResourceKey<PlacedFeature> TREES_OLD_GROWTH_SPRUCE_TAIGA = PlacementUtils.createKey("trees_old_growth_spruce_taiga");
|
| 124 | public static final ResourceKey<PlacedFeature> TREES_OLD_GROWTH_PINE_TAIGA = PlacementUtils.createKey("trees_old_growth_pine_taiga");
|
| 125 | public static final ResourceKey<PlacedFeature> TREES_JUNGLE = PlacementUtils.createKey("trees_jungle");
|
| 126 | public static final ResourceKey<PlacedFeature> TREES_DAPPLED_FOREST = PlacementUtils.createKey("trees_dappled_forest");
|
| 127 | public static final ResourceKey<PlacedFeature> BAMBOO_VEGETATION = PlacementUtils.createKey("bamboo_vegetation");
|
| 128 | public static final ResourceKey<PlacedFeature> MUSHROOM_ISLAND_VEGETATION = PlacementUtils.createKey("mushroom_island_vegetation");
|
| 129 | public static final ResourceKey<PlacedFeature> TREES_MANGROVE = PlacementUtils.createKey("trees_mangrove");
|
| 130 | private static final PlacementModifier TREE_THRESHOLD = SurfaceWaterDepthFilter.forMaxDepth(0);
|
| 131 |
|
| 132 | public static List<PlacementModifier> worldSurfaceSquaredWithCount(final int count) {
|
| 133 | return List.of(CountPlacement.of(count), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_WORLD_SURFACE, BiomeFilter.biome());
|
| 134 | }
|
| 135 |
|
| 136 | private static List<PlacementModifier> getMushroomPlacement(final int rarity, final @Nullable PlacementModifier prefix) {
|
| 137 | Builder<PlacementModifier> builder = ImmutableList.builder();
|
| 138 | if (prefix != null) {
|
| 139 | builder.add(prefix);
|
| 140 | }
|
| 141 |
|
| 142 | if (rarity != 0) {
|
| 143 | builder.add(RarityFilter.onAverageOnceEvery(rarity));
|
| 144 | }
|
| 145 |
|
| 146 | builder.add(InSquarePlacement.spread());
|
| 147 | builder.add(PlacementUtils.HEIGHTMAP);
|
| 148 | builder.add(BiomeFilter.biome());
|
| 149 | builder.add(CountPlacement.of(96));
|
| 150 | builder.add(OffsetPlacement.ofTriangle(7, 3));
|
| 151 | builder.add(BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE));
|
| 152 | return builder.build();
|
| 153 | }
|
| 154 |
|
| 155 | private static Builder<PlacementModifier> treePlacementBase(final PlacementModifier frequency) {
|
| 156 | return ImmutableList.<PlacementModifier>builder()
|
| 157 | .add(frequency)
|
| 158 | .add(InSquarePlacement.spread())
|
| 159 | .add(TREE_THRESHOLD)
|
| 160 | .add(PlacementUtils.HEIGHTMAP_OCEAN_FLOOR)
|
| 161 | .add(BiomeFilter.biome());
|
| 162 | }
|
| 163 |
|
| 164 | public static List<PlacementModifier> treePlacement(final PlacementModifier frequency) {
|
| 165 | return treePlacementBase(frequency).build();
|
| 166 | }
|
| 167 |
|
| 168 | public static List<PlacementModifier> treePlacement(final PlacementModifier frequency, final Block sapling) {
|
| 169 | return treePlacementBase(frequency).add(BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(sapling))).build();
|
| 170 | }
|
| 171 |
|
| 172 | public static void bootstrap(final BootstrapContext<PlacedFeature> context) {
|
| 173 | HolderGetter<Feature> configuredFeatures = context.lookup(Registries.FEATURE);
|
| 174 | Holder<Feature> bambooNoPodzol = configuredFeatures.getOrThrow(VegetationFeatures.BAMBOO_NO_PODZOL);
|
| 175 | Holder<Feature> bambooSomePodzol = configuredFeatures.getOrThrow(VegetationFeatures.BAMBOO_SOME_PODZOL);
|
| 176 | Holder<Feature> vines = configuredFeatures.getOrThrow(VegetationFeatures.VINES);
|
| 177 | Holder<Feature> sunflower = configuredFeatures.getOrThrow(VegetationFeatures.SUNFLOWER);
|
| 178 | Holder<Feature> pumpkin = configuredFeatures.getOrThrow(VegetationFeatures.PUMPKIN);
|
| 179 | Holder<Feature> grass = configuredFeatures.getOrThrow(VegetationFeatures.GRASS);
|
| 180 | Holder<Feature> leafLitter = configuredFeatures.getOrThrow(VegetationFeatures.LEAF_LITTER);
|
| 181 | Holder<Feature> taigaGrass = configuredFeatures.getOrThrow(VegetationFeatures.TAIGA_GRASS);
|
| 182 | Holder<Feature> grassJungle = configuredFeatures.getOrThrow(VegetationFeatures.GRASS_JUNGLE);
|
| 183 | Holder<Feature> deadBush = configuredFeatures.getOrThrow(VegetationFeatures.DEAD_BUSH);
|
| 184 | Holder<Feature> dryGrass = configuredFeatures.getOrThrow(VegetationFeatures.DRY_GRASS);
|
| 185 | Holder<Feature> fireflyBush = configuredFeatures.getOrThrow(VegetationFeatures.FIREFLY_BUSH);
|
| 186 | Holder<Feature> melon = configuredFeatures.getOrThrow(VegetationFeatures.MELON);
|
| 187 | Holder<Feature> berryBush = configuredFeatures.getOrThrow(VegetationFeatures.BERRY_BUSH);
|
| 188 | Holder<Feature> waterlily = configuredFeatures.getOrThrow(VegetationFeatures.WATERLILY);
|
| 189 | Holder<Feature> tallGrass = configuredFeatures.getOrThrow(VegetationFeatures.TALL_GRASS);
|
| 190 | Holder<Feature> largeFern = configuredFeatures.getOrThrow(VegetationFeatures.LARGE_FERN);
|
| 191 | Holder<Feature> bush = configuredFeatures.getOrThrow(VegetationFeatures.BUSH);
|
| 192 | Holder<Feature> redShrub = configuredFeatures.getOrThrow(VegetationFeatures.RED_SHRUB);
|
| 193 | Holder<Feature> cactus = configuredFeatures.getOrThrow(VegetationFeatures.CACTUS);
|
| 194 | Holder<Feature> sugarCane = configuredFeatures.getOrThrow(VegetationFeatures.SUGAR_CANE);
|
| 195 | Holder<Feature> brownMushroom = configuredFeatures.getOrThrow(VegetationFeatures.BROWN_MUSHROOM);
|
| 196 | Holder<Feature> redMushroom = configuredFeatures.getOrThrow(VegetationFeatures.RED_MUSHROOM);
|
| 197 | Holder<Feature> flowerDefault = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_DEFAULT);
|
| 198 | Holder<Feature> flowerFlowerForest = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_FLOWER_FOREST);
|
| 199 | Holder<Feature> flowerSwamp = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_SWAMP);
|
| 200 | Holder<Feature> flowerPlain = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_PLAIN);
|
| 201 | Holder<Feature> flowerMeadow = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_MEADOW);
|
| 202 | Holder<Feature> flowerCherry = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_CHERRY);
|
| 203 | Holder<Feature> flowerPaleGarden = configuredFeatures.getOrThrow(VegetationFeatures.FLOWER_PALE_GARDEN);
|
| 204 | Holder<Feature> wildflower = configuredFeatures.getOrThrow(VegetationFeatures.WILDFLOWER);
|
| 205 | Holder<Feature> treesPlains = configuredFeatures.getOrThrow(VegetationFeatures.TREES_PLAINS);
|
| 206 | Holder<Feature> darkForestVegetation = configuredFeatures.getOrThrow(VegetationFeatures.DARK_FOREST_VEGETATION);
|
| 207 | Holder<Feature> paleGardenVegetation = configuredFeatures.getOrThrow(VegetationFeatures.PALE_GARDEN_VEGETATION);
|
| 208 | Holder<Feature> forestFlowers = configuredFeatures.getOrThrow(VegetationFeatures.FOREST_FLOWERS);
|
| 209 | Holder<Feature> paleForestFlower = configuredFeatures.getOrThrow(VegetationFeatures.PALE_FOREST_FLOWER);
|
| 210 | Holder<Feature> paleMossPatch = configuredFeatures.getOrThrow(VegetationFeatures.PALE_MOSS_PATCH);
|
| 211 | Holder<Feature> treesFlowerForest = configuredFeatures.getOrThrow(VegetationFeatures.TREES_FLOWER_FOREST);
|
| 212 | Holder<Feature> meadowTrees = configuredFeatures.getOrThrow(VegetationFeatures.MEADOW_TREES);
|
| 213 | Holder<Feature> treesTaiga = configuredFeatures.getOrThrow(VegetationFeatures.TREES_TAIGA);
|
| 214 | Holder<Feature> treesBadlands = configuredFeatures.getOrThrow(VegetationFeatures.TREES_BADLANDS);
|
| 215 | Holder<Feature> treesGrove = configuredFeatures.getOrThrow(VegetationFeatures.TREES_GROVE);
|
| 216 | Holder<Feature> treesSnowy = configuredFeatures.getOrThrow(VegetationFeatures.TREES_SNOWY);
|
| 217 | Holder<Feature> cherryBees005 = configuredFeatures.getOrThrow(TreeFeatures.CHERRY_BEES_005);
|
| 218 | Holder<Feature> swampOak = configuredFeatures.getOrThrow(TreeFeatures.SWAMP_OAK);
|
| 219 | Holder<Feature> treesSavanna = configuredFeatures.getOrThrow(VegetationFeatures.TREES_SAVANNA);
|
| 220 | Holder<Feature> birchTall = configuredFeatures.getOrThrow(VegetationFeatures.BIRCH_TALL);
|
| 221 | Holder<Feature> treesBirch = configuredFeatures.getOrThrow(VegetationFeatures.TREES_BIRCH);
|
| 222 | Holder<Feature> treesWindsweptHills = configuredFeatures.getOrThrow(VegetationFeatures.TREES_WINDSWEPT_HILLS);
|
| 223 | Holder<Feature> treesWater = configuredFeatures.getOrThrow(VegetationFeatures.TREES_WATER);
|
| 224 | Holder<Feature> treesBirchAndOakLeafLitter = configuredFeatures.getOrThrow(VegetationFeatures.TREES_BIRCH_AND_OAK_LEAF_LITTER);
|
| 225 | Holder<Feature> treesSparseJungle = configuredFeatures.getOrThrow(VegetationFeatures.TREES_SPARSE_JUNGLE);
|
| 226 | Holder<Feature> treesOldGrowthSpruceTaiga = configuredFeatures.getOrThrow(VegetationFeatures.TREES_OLD_GROWTH_SPRUCE_TAIGA);
|
| 227 | Holder<Feature> treesOldGrowthPineTaiga = configuredFeatures.getOrThrow(VegetationFeatures.TREES_OLD_GROWTH_PINE_TAIGA);
|
| 228 | Holder<Feature> treesJungle = configuredFeatures.getOrThrow(VegetationFeatures.TREES_JUNGLE);
|
| 229 | Holder<Feature> treesDappledForest = configuredFeatures.getOrThrow(VegetationFeatures.TREES_DAPPLED_FOREST);
|
| 230 | Holder<Feature> bambooVegetation = configuredFeatures.getOrThrow(VegetationFeatures.BAMBOO_VEGETATION);
|
| 231 | Holder<Feature> mushroomIslandVegetation = configuredFeatures.getOrThrow(VegetationFeatures.MUSHROOM_ISLAND_VEGETATION);
|
| 232 | Holder<Feature> mangroveVegetation = configuredFeatures.getOrThrow(VegetationFeatures.MANGROVE_VEGETATION);
|
| 233 | PlacementUtils.register(
|
| 234 | context, BAMBOO_LIGHT, bambooNoPodzol, RarityFilter.onAverageOnceEvery(4), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome()
|
| 235 | );
|
| 236 | PlacementUtils.register(
|
| 237 | context,
|
| 238 | BAMBOO,
|
| 239 | bambooSomePodzol,
|
| 240 | NoiseBasedCountPlacement.of(160, 80.0, 0.3),
|
| 241 | InSquarePlacement.spread(),
|
| 242 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 243 | BiomeFilter.biome()
|
| 244 | );
|
| 245 | PlacementUtils.register(context, BAMBOO_IN_STRUCTURE, bambooNoPodzol, PlacementUtils.isEmpty());
|
| 246 | PlacementUtils.register(
|
| 247 | context,
|
| 248 | VINES,
|
| 249 | vines,
|
| 250 | CountPlacement.of(127),
|
| 251 | InSquarePlacement.spread(),
|
| 252 | HeightRangePlacement.uniform(VerticalAnchor.absolute(64), VerticalAnchor.absolute(100)),
|
| 253 | BiomeFilter.biome()
|
| 254 | );
|
| 255 | PlacementUtils.register(
|
| 256 | context,
|
| 257 | PATCH_SUNFLOWER,
|
| 258 | sunflower,
|
| 259 | RarityFilter.onAverageOnceEvery(3),
|
| 260 | InSquarePlacement.spread(),
|
| 261 | PlacementUtils.HEIGHTMAP,
|
| 262 | BiomeFilter.biome(),
|
| 263 | CountPlacement.of(96),
|
| 264 | OffsetPlacement.ofTriangle(7, 3),
|
| 265 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 266 | );
|
| 267 | PlacementUtils.register(
|
| 268 | context,
|
| 269 | PATCH_PUMPKIN,
|
| 270 | pumpkin,
|
| 271 | RarityFilter.onAverageOnceEvery(300),
|
| 272 | InSquarePlacement.spread(),
|
| 273 | PlacementUtils.HEIGHTMAP,
|
| 274 | BiomeFilter.biome(),
|
| 275 | CountPlacement.of(96),
|
| 276 | OffsetPlacement.ofTriangle(7, 3),
|
| 277 | BlockPredicateFilter.forPredicate(
|
| 278 | BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.matchesBlocks(Direction.DOWN, Blocks.GRASS_BLOCK))
|
| 279 | )
|
| 280 | );
|
| 281 | PlacementUtils.register(
|
| 282 | context,
|
| 283 | PATCH_GRASS_PLAIN,
|
| 284 | grass,
|
| 285 | NoiseThresholdCountPlacement.of(-0.8, 5, 10),
|
| 286 | InSquarePlacement.spread(),
|
| 287 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 288 | BiomeFilter.biome(),
|
| 289 | CountPlacement.of(32),
|
| 290 | OffsetPlacement.ofTriangle(7, 3),
|
| 291 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 292 | );
|
| 293 | PlacementUtils.register(
|
| 294 | context,
|
| 295 | PATCH_GRASS_MEADOW,
|
| 296 | grass,
|
| 297 | NoiseThresholdCountPlacement.of(-0.8, 5, 10),
|
| 298 | InSquarePlacement.spread(),
|
| 299 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 300 | BiomeFilter.biome(),
|
| 301 | CountPlacement.of(16),
|
| 302 | OffsetPlacement.ofTriangle(7, 3),
|
| 303 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 304 | );
|
| 305 | PlacementUtils.register(
|
| 306 | context,
|
| 307 | PATCH_GRASS_FOREST,
|
| 308 | grass,
|
| 309 | Util.copyAndAdd(
|
| 310 | worldSurfaceSquaredWithCount(2),
|
| 311 | CountPlacement.of(32),
|
| 312 | OffsetPlacement.ofTriangle(7, 3),
|
| 313 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 314 | )
|
| 315 | );
|
| 316 | PlacementUtils.register(
|
| 317 | context,
|
| 318 | PATCH_LEAF_LITTER,
|
| 319 | leafLitter,
|
| 320 | Util.copyAndAdd(
|
| 321 | worldSurfaceSquaredWithCount(2),
|
| 322 | CountPlacement.of(32),
|
| 323 | OffsetPlacement.ofTriangle(7, 3),
|
| 324 | BlockPredicateFilter.forPredicate(
|
| 325 | BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.matchesBlocks(Direction.DOWN, Blocks.GRASS_BLOCK))
|
| 326 | )
|
| 327 | )
|
| 328 | );
|
| 329 | PlacementUtils.register(
|
| 330 | context,
|
| 331 | PATCH_GRASS_BADLANDS,
|
| 332 | grass,
|
| 333 | InSquarePlacement.spread(),
|
| 334 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 335 | BiomeFilter.biome(),
|
| 336 | CountPlacement.of(32),
|
| 337 | OffsetPlacement.ofTriangle(7, 3),
|
| 338 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 339 | );
|
| 340 | PlacementUtils.register(
|
| 341 | context,
|
| 342 | PATCH_GRASS_SAVANNA,
|
| 343 | grass,
|
| 344 | Util.copyAndAdd(
|
| 345 | worldSurfaceSquaredWithCount(20),
|
| 346 | CountPlacement.of(32),
|
| 347 | OffsetPlacement.ofTriangle(7, 3),
|
| 348 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 349 | )
|
| 350 | );
|
| 351 | PlacementUtils.register(
|
| 352 | context,
|
| 353 | PATCH_GRASS_NORMAL,
|
| 354 | grass,
|
| 355 | Util.copyAndAdd(
|
| 356 | worldSurfaceSquaredWithCount(5),
|
| 357 | CountPlacement.of(32),
|
| 358 | OffsetPlacement.ofTriangle(7, 3),
|
| 359 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 360 | )
|
| 361 | );
|
| 362 | PlacementUtils.register(
|
| 363 | context,
|
| 364 | PATCH_GRASS_TAIGA_2,
|
| 365 | taigaGrass,
|
| 366 | InSquarePlacement.spread(),
|
| 367 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 368 | BiomeFilter.biome(),
|
| 369 | CountPlacement.of(32),
|
| 370 | OffsetPlacement.ofTriangle(7, 3),
|
| 371 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 372 | );
|
| 373 | PlacementUtils.register(
|
| 374 | context,
|
| 375 | PATCH_GRASS_TAIGA,
|
| 376 | taigaGrass,
|
| 377 | Util.copyAndAdd(
|
| 378 | worldSurfaceSquaredWithCount(7),
|
| 379 | CountPlacement.of(32),
|
| 380 | OffsetPlacement.ofTriangle(7, 3),
|
| 381 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 382 | )
|
| 383 | );
|
| 384 | PlacementUtils.register(
|
| 385 | context,
|
| 386 | PATCH_GRASS_JUNGLE,
|
| 387 | grassJungle,
|
| 388 | Util.copyAndAdd(
|
| 389 | worldSurfaceSquaredWithCount(25),
|
| 390 | CountPlacement.of(32),
|
| 391 | OffsetPlacement.ofTriangle(7, 3),
|
| 392 | BlockPredicateFilter.forPredicate(
|
| 393 | BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.not(BlockPredicate.matchesBlocks(Direction.DOWN, Blocks.PODZOL)))
|
| 394 | )
|
| 395 | )
|
| 396 | );
|
| 397 | PlacementUtils.register(context, GRASS_BONEMEAL, grass, PlacementUtils.isEmpty());
|
| 398 | PlacementUtils.register(
|
| 399 | context,
|
| 400 | PATCH_DEAD_BUSH_2,
|
| 401 | deadBush,
|
| 402 | Util.copyAndAdd(
|
| 403 | worldSurfaceSquaredWithCount(2),
|
| 404 | CountPlacement.of(4),
|
| 405 | OffsetPlacement.ofTriangle(7, 3),
|
| 406 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 407 | )
|
| 408 | );
|
| 409 | PlacementUtils.register(
|
| 410 | context,
|
| 411 | PATCH_DEAD_BUSH,
|
| 412 | deadBush,
|
| 413 | InSquarePlacement.spread(),
|
| 414 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 415 | BiomeFilter.biome(),
|
| 416 | CountPlacement.of(4),
|
| 417 | OffsetPlacement.ofTriangle(7, 3),
|
| 418 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 419 | );
|
| 420 | PlacementUtils.register(
|
| 421 | context,
|
| 422 | PATCH_DEAD_BUSH_BADLANDS,
|
| 423 | deadBush,
|
| 424 | Util.copyAndAdd(
|
| 425 | worldSurfaceSquaredWithCount(20),
|
| 426 | CountPlacement.of(4),
|
| 427 | OffsetPlacement.ofTriangle(7, 3),
|
| 428 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 429 | )
|
| 430 | );
|
| 431 | PlacementUtils.register(
|
| 432 | context,
|
| 433 | PATCH_DRY_GRASS_BADLANDS,
|
| 434 | dryGrass,
|
| 435 | RarityFilter.onAverageOnceEvery(6),
|
| 436 | InSquarePlacement.spread(),
|
| 437 | PlacementUtils.HEIGHTMAP,
|
| 438 | BiomeFilter.biome(),
|
| 439 | CountPlacement.of(64),
|
| 440 | OffsetPlacement.ofTriangle(7, 3),
|
| 441 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 442 | );
|
| 443 | PlacementUtils.register(
|
| 444 | context,
|
| 445 | PATCH_DRY_GRASS_DESERT,
|
| 446 | dryGrass,
|
| 447 | RarityFilter.onAverageOnceEvery(3),
|
| 448 | InSquarePlacement.spread(),
|
| 449 | PlacementUtils.HEIGHTMAP,
|
| 450 | BiomeFilter.biome(),
|
| 451 | CountPlacement.of(64),
|
| 452 | OffsetPlacement.ofTriangle(7, 3),
|
| 453 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 454 | );
|
| 455 | BlockPredicate melonPlacementPredicate = BlockPredicate.allOf(
|
| 456 | BlockPredicate.replaceable(), BlockPredicate.noFluid(), BlockPredicate.matchesBlocks(Direction.DOWN, Blocks.GRASS_BLOCK)
|
| 457 | );
|
| 458 | PlacementUtils.register(
|
| 459 | context,
|
| 460 | PATCH_MELON,
|
| 461 | melon,
|
| 462 | RarityFilter.onAverageOnceEvery(6),
|
| 463 | InSquarePlacement.spread(),
|
| 464 | PlacementUtils.HEIGHTMAP,
|
| 465 | BiomeFilter.biome(),
|
| 466 | CountPlacement.of(64),
|
| 467 | OffsetPlacement.ofTriangle(7, 3),
|
| 468 | BlockPredicateFilter.forPredicate(melonPlacementPredicate)
|
| 469 | );
|
| 470 | PlacementUtils.register(
|
| 471 | context,
|
| 472 | PATCH_MELON_SPARSE,
|
| 473 | melon,
|
| 474 | RarityFilter.onAverageOnceEvery(64),
|
| 475 | InSquarePlacement.spread(),
|
| 476 | PlacementUtils.HEIGHTMAP,
|
| 477 | BiomeFilter.biome(),
|
| 478 | CountPlacement.of(64),
|
| 479 | OffsetPlacement.ofTriangle(7, 3),
|
| 480 | BlockPredicateFilter.forPredicate(melonPlacementPredicate)
|
| 481 | );
|
| 482 | PlacementUtils.register(
|
| 483 | context,
|
| 484 | PATCH_BERRY_COMMON,
|
| 485 | berryBush,
|
| 486 | RarityFilter.onAverageOnceEvery(32),
|
| 487 | InSquarePlacement.spread(),
|
| 488 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 489 | BiomeFilter.biome(),
|
| 490 | CountPlacement.of(96),
|
| 491 | OffsetPlacement.ofTriangle(7, 3),
|
| 492 | BlockPredicateFilter.forPredicate(
|
| 493 | BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.matchesBlocks(Direction.DOWN, Blocks.GRASS_BLOCK))
|
| 494 | )
|
| 495 | );
|
| 496 | PlacementUtils.register(
|
| 497 | context,
|
| 498 | PATCH_BERRY_RARE,
|
| 499 | berryBush,
|
| 500 | RarityFilter.onAverageOnceEvery(384),
|
| 501 | InSquarePlacement.spread(),
|
| 502 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 503 | BiomeFilter.biome(),
|
| 504 | CountPlacement.of(96),
|
| 505 | OffsetPlacement.ofTriangle(7, 3),
|
| 506 | BlockPredicateFilter.forPredicate(
|
| 507 | BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.matchesBlocks(Direction.DOWN, Blocks.GRASS_BLOCK))
|
| 508 | )
|
| 509 | );
|
| 510 | PlacementUtils.register(
|
| 511 | context,
|
| 512 | PATCH_WATERLILY,
|
| 513 | waterlily,
|
| 514 | Util.copyAndAdd(
|
| 515 | worldSurfaceSquaredWithCount(4),
|
| 516 | CountPlacement.of(10),
|
| 517 | OffsetPlacement.ofTriangle(7, 3),
|
| 518 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 519 | )
|
| 520 | );
|
| 521 | PlacementUtils.register(
|
| 522 | context,
|
| 523 | PATCH_TALL_GRASS_2,
|
| 524 | tallGrass,
|
| 525 | NoiseThresholdCountPlacement.of(-0.8, 0, 7),
|
| 526 | RarityFilter.onAverageOnceEvery(32),
|
| 527 | InSquarePlacement.spread(),
|
| 528 | PlacementUtils.HEIGHTMAP,
|
| 529 | BiomeFilter.biome(),
|
| 530 | CountPlacement.of(96),
|
| 531 | OffsetPlacement.ofTriangle(7, 3),
|
| 532 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 533 | );
|
| 534 | PlacementUtils.register(
|
| 535 | context,
|
| 536 | PATCH_TALL_GRASS,
|
| 537 | tallGrass,
|
| 538 | RarityFilter.onAverageOnceEvery(5),
|
| 539 | InSquarePlacement.spread(),
|
| 540 | PlacementUtils.HEIGHTMAP,
|
| 541 | BiomeFilter.biome(),
|
| 542 | CountPlacement.of(96),
|
| 543 | OffsetPlacement.ofTriangle(7, 3),
|
| 544 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 545 | );
|
| 546 | PlacementUtils.register(
|
| 547 | context,
|
| 548 | PATCH_LARGE_FERN,
|
| 549 | largeFern,
|
| 550 | RarityFilter.onAverageOnceEvery(5),
|
| 551 | InSquarePlacement.spread(),
|
| 552 | PlacementUtils.HEIGHTMAP,
|
| 553 | BiomeFilter.biome(),
|
| 554 | CountPlacement.of(96),
|
| 555 | OffsetPlacement.ofTriangle(7, 3),
|
| 556 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 557 | );
|
| 558 | PlacementUtils.register(
|
| 559 | context,
|
| 560 | PATCH_BUSH,
|
| 561 | bush,
|
| 562 | RarityFilter.onAverageOnceEvery(4),
|
| 563 | InSquarePlacement.spread(),
|
| 564 | PlacementUtils.HEIGHTMAP,
|
| 565 | BiomeFilter.biome(),
|
| 566 | CountPlacement.of(24),
|
| 567 | OffsetPlacement.ofTriangle(5, 3),
|
| 568 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 569 | );
|
| 570 | PlacementUtils.register(
|
| 571 | context,
|
| 572 | PATCH_RED_SHRUB,
|
| 573 | redShrub,
|
| 574 | InSquarePlacement.spread(),
|
| 575 | PlacementUtils.HEIGHTMAP_WORLD_SURFACE,
|
| 576 | BiomeFilter.biome(),
|
| 577 | CountPlacement.of(8),
|
| 578 | OffsetPlacement.ofTriangle(7, 3),
|
| 579 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 580 | );
|
| 581 | PlacementUtils.register(
|
| 582 | context,
|
| 583 | PATCH_CACTUS_DESERT,
|
| 584 | cactus,
|
| 585 | RarityFilter.onAverageOnceEvery(6),
|
| 586 | InSquarePlacement.spread(),
|
| 587 | PlacementUtils.HEIGHTMAP,
|
| 588 | BiomeFilter.biome(),
|
| 589 | CountPlacement.of(10),
|
| 590 | OffsetPlacement.ofTriangle(7, 3),
|
| 591 | BlockPredicateFilter.forPredicate(BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.wouldSurvive(Blocks.CACTUS)))
|
| 592 | );
|
| 593 | PlacementUtils.register(
|
| 594 | context,
|
| 595 | PATCH_CACTUS_DECORATED,
|
| 596 | cactus,
|
| 597 | RarityFilter.onAverageOnceEvery(13),
|
| 598 | InSquarePlacement.spread(),
|
| 599 | PlacementUtils.HEIGHTMAP,
|
| 600 | BiomeFilter.biome(),
|
| 601 | CountPlacement.of(10),
|
| 602 | OffsetPlacement.ofTriangle(7, 3),
|
| 603 | BlockPredicateFilter.forPredicate(BlockPredicate.allOf(BlockPredicate.ONLY_IN_AIR_PREDICATE, BlockPredicate.wouldSurvive(Blocks.CACTUS)))
|
| 604 | );
|
| 605 | PlacementUtils.register(
|
| 606 | context,
|
| 607 | PATCH_SUGAR_CANE_SWAMP,
|
| 608 | sugarCane,
|
| 609 | RarityFilter.onAverageOnceEvery(3),
|
| 610 | InSquarePlacement.spread(),
|
| 611 | PlacementUtils.HEIGHTMAP,
|
| 612 | BiomeFilter.biome(),
|
| 613 | CountPlacement.of(20),
|
| 614 | OffsetPlacement.ofTriangle(4, 0),
|
| 615 | VegetationFeatures.nearWaterPredicate(Blocks.SUGAR_CANE)
|
| 616 | );
|
| 617 | PlacementUtils.register(
|
| 618 | context,
|
| 619 | PATCH_SUGAR_CANE_DESERT,
|
| 620 | sugarCane,
|
| 621 | InSquarePlacement.spread(),
|
| 622 | PlacementUtils.HEIGHTMAP,
|
| 623 | BiomeFilter.biome(),
|
| 624 | CountPlacement.of(20),
|
| 625 | OffsetPlacement.ofTriangle(4, 0),
|
| 626 | VegetationFeatures.nearWaterPredicate(Blocks.SUGAR_CANE)
|
| 627 | );
|
| 628 | PlacementUtils.register(
|
| 629 | context,
|
| 630 | PATCH_SUGAR_CANE_BADLANDS,
|
| 631 | sugarCane,
|
| 632 | RarityFilter.onAverageOnceEvery(5),
|
| 633 | InSquarePlacement.spread(),
|
| 634 | PlacementUtils.HEIGHTMAP,
|
| 635 | BiomeFilter.biome(),
|
| 636 | CountPlacement.of(20),
|
| 637 | OffsetPlacement.ofTriangle(4, 0),
|
| 638 | VegetationFeatures.nearWaterPredicate(Blocks.SUGAR_CANE)
|
| 639 | );
|
| 640 | PlacementUtils.register(
|
| 641 | context,
|
| 642 | PATCH_SUGAR_CANE,
|
| 643 | sugarCane,
|
| 644 | RarityFilter.onAverageOnceEvery(6),
|
| 645 | InSquarePlacement.spread(),
|
| 646 | PlacementUtils.HEIGHTMAP,
|
| 647 | BiomeFilter.biome(),
|
| 648 | CountPlacement.of(20),
|
| 649 | OffsetPlacement.ofTriangle(4, 0),
|
| 650 | VegetationFeatures.nearWaterPredicate(Blocks.SUGAR_CANE)
|
| 651 | );
|
| 652 | PlacementUtils.register(
|
| 653 | context,
|
| 654 | PATCH_FIREFLY_BUSH_NEAR_WATER,
|
| 655 | fireflyBush,
|
| 656 | CountPlacement.of(2),
|
| 657 | InSquarePlacement.spread(),
|
| 658 | PlacementUtils.HEIGHTMAP_NO_LEAVES,
|
| 659 | BiomeFilter.biome(),
|
| 660 | VegetationFeatures.nearWaterPredicate(Blocks.FIREFLY_BUSH),
|
| 661 | CountPlacement.of(20),
|
| 662 | OffsetPlacement.ofTriangle(4, 3),
|
| 663 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 664 | );
|
| 665 | PlacementUtils.register(
|
| 666 | context,
|
| 667 | PATCH_FIREFLY_BUSH_NEAR_WATER_SWAMP,
|
| 668 | fireflyBush,
|
| 669 | CountPlacement.of(3),
|
| 670 | InSquarePlacement.spread(),
|
| 671 | PlacementUtils.HEIGHTMAP,
|
| 672 | BiomeFilter.biome(),
|
| 673 | VegetationFeatures.nearWaterPredicate(Blocks.FIREFLY_BUSH),
|
| 674 | CountPlacement.of(20),
|
| 675 | OffsetPlacement.ofTriangle(4, 3),
|
| 676 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 677 | );
|
| 678 | PlacementUtils.register(
|
| 679 | context,
|
| 680 | PATCH_FIREFLY_BUSH_SWAMP,
|
| 681 | fireflyBush,
|
| 682 | RarityFilter.onAverageOnceEvery(8),
|
| 683 | InSquarePlacement.spread(),
|
| 684 | PlacementUtils.HEIGHTMAP,
|
| 685 | BiomeFilter.biome(),
|
| 686 | CountPlacement.of(20),
|
| 687 | OffsetPlacement.ofTriangle(4, 3),
|
| 688 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 689 | );
|
| 690 | PlacementUtils.register(
|
| 691 | context,
|
| 692 | BROWN_MUSHROOM_NETHER,
|
| 693 | brownMushroom,
|
| 694 | RarityFilter.onAverageOnceEvery(2),
|
| 695 | InSquarePlacement.spread(),
|
| 696 | PlacementUtils.FULL_RANGE,
|
| 697 | BiomeFilter.biome(),
|
| 698 | CountPlacement.of(96),
|
| 699 | OffsetPlacement.ofTriangle(7, 3),
|
| 700 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 701 | );
|
| 702 | PlacementUtils.register(
|
| 703 | context,
|
| 704 | RED_MUSHROOM_NETHER,
|
| 705 | redMushroom,
|
| 706 | RarityFilter.onAverageOnceEvery(2),
|
| 707 | InSquarePlacement.spread(),
|
| 708 | PlacementUtils.FULL_RANGE,
|
| 709 | BiomeFilter.biome(),
|
| 710 | CountPlacement.of(96),
|
| 711 | OffsetPlacement.ofTriangle(7, 3),
|
| 712 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 713 | );
|
| 714 | PlacementUtils.register(context, BROWN_MUSHROOM_NORMAL, brownMushroom, getMushroomPlacement(256, null));
|
| 715 | PlacementUtils.register(context, RED_MUSHROOM_NORMAL, redMushroom, getMushroomPlacement(512, null));
|
| 716 | PlacementUtils.register(context, BROWN_MUSHROOM_TAIGA, brownMushroom, getMushroomPlacement(4, null));
|
| 717 | PlacementUtils.register(context, RED_MUSHROOM_TAIGA, redMushroom, getMushroomPlacement(256, null));
|
| 718 | PlacementUtils.register(context, BROWN_MUSHROOM_OLD_GROWTH, brownMushroom, getMushroomPlacement(4, CountPlacement.of(3)));
|
| 719 | PlacementUtils.register(context, RED_MUSHROOM_OLD_GROWTH, redMushroom, getMushroomPlacement(171, null));
|
| 720 | PlacementUtils.register(context, BROWN_MUSHROOM_SWAMP, brownMushroom, getMushroomPlacement(0, CountPlacement.of(2)));
|
| 721 | PlacementUtils.register(context, RED_MUSHROOM_SWAMP, redMushroom, getMushroomPlacement(64, null));
|
| 722 | PlacementUtils.register(context, BROWN_MUSHROOM_DAPPLED_FOREST, brownMushroom, getMushroomPlacement(2, null));
|
| 723 | PlacementUtils.register(
|
| 724 | context,
|
| 725 | FLOWER_WARM,
|
| 726 | flowerDefault,
|
| 727 | RarityFilter.onAverageOnceEvery(16),
|
| 728 | InSquarePlacement.spread(),
|
| 729 | PlacementUtils.HEIGHTMAP,
|
| 730 | BiomeFilter.biome(),
|
| 731 | CountPlacement.of(64),
|
| 732 | OffsetPlacement.ofTriangle(7, 3),
|
| 733 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 734 | );
|
| 735 | PlacementUtils.register(
|
| 736 | context,
|
| 737 | FLOWER_DEFAULT,
|
| 738 | flowerDefault,
|
| 739 | RarityFilter.onAverageOnceEvery(32),
|
| 740 | InSquarePlacement.spread(),
|
| 741 | PlacementUtils.HEIGHTMAP,
|
| 742 | BiomeFilter.biome(),
|
| 743 | CountPlacement.of(64),
|
| 744 | OffsetPlacement.ofTriangle(7, 3),
|
| 745 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 746 | );
|
| 747 | PlacementUtils.register(
|
| 748 | context,
|
| 749 | FLOWER_FLOWER_FOREST,
|
| 750 | flowerFlowerForest,
|
| 751 | CountPlacement.of(3),
|
| 752 | RarityFilter.onAverageOnceEvery(2),
|
| 753 | InSquarePlacement.spread(),
|
| 754 | PlacementUtils.HEIGHTMAP,
|
| 755 | BiomeFilter.biome(),
|
| 756 | CountPlacement.of(96),
|
| 757 | OffsetPlacement.ofTriangle(6, 2),
|
| 758 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 759 | );
|
| 760 | PlacementUtils.register(
|
| 761 | context,
|
| 762 | FLOWER_SWAMP,
|
| 763 | flowerSwamp,
|
| 764 | RarityFilter.onAverageOnceEvery(32),
|
| 765 | InSquarePlacement.spread(),
|
| 766 | PlacementUtils.HEIGHTMAP,
|
| 767 | BiomeFilter.biome(),
|
| 768 | CountPlacement.of(64),
|
| 769 | OffsetPlacement.ofTriangle(6, 2),
|
| 770 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 771 | );
|
| 772 | PlacementUtils.register(
|
| 773 | context,
|
| 774 | FLOWER_PLAINS,
|
| 775 | flowerPlain,
|
| 776 | NoiseThresholdCountPlacement.of(-0.8, 15, 4),
|
| 777 | RarityFilter.onAverageOnceEvery(32),
|
| 778 | InSquarePlacement.spread(),
|
| 779 | PlacementUtils.HEIGHTMAP,
|
| 780 | BiomeFilter.biome(),
|
| 781 | CountPlacement.of(64),
|
| 782 | OffsetPlacement.ofTriangle(6, 2),
|
| 783 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 784 | );
|
| 785 | PlacementUtils.register(
|
| 786 | context,
|
| 787 | FLOWER_CHERRY,
|
| 788 | flowerCherry,
|
| 789 | NoiseThresholdCountPlacement.of(-0.8, 5, 10),
|
| 790 | InSquarePlacement.spread(),
|
| 791 | PlacementUtils.HEIGHTMAP,
|
| 792 | BiomeFilter.biome(),
|
| 793 | CountPlacement.of(96),
|
| 794 | OffsetPlacement.ofTriangle(6, 2),
|
| 795 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 796 | );
|
| 797 | PlacementUtils.register(
|
| 798 | context,
|
| 799 | FLOWER_MEADOW,
|
| 800 | flowerMeadow,
|
| 801 | InSquarePlacement.spread(),
|
| 802 | PlacementUtils.HEIGHTMAP,
|
| 803 | BiomeFilter.biome(),
|
| 804 | CountPlacement.of(96),
|
| 805 | OffsetPlacement.ofTriangle(6, 2),
|
| 806 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 807 | );
|
| 808 | PlacementUtils.register(
|
| 809 | context,
|
| 810 | FLOWER_PALE_GARDEN,
|
| 811 | flowerPaleGarden,
|
| 812 | RarityFilter.onAverageOnceEvery(32),
|
| 813 | InSquarePlacement.spread(),
|
| 814 | PlacementUtils.HEIGHTMAP,
|
| 815 | BiomeFilter.biome()
|
| 816 | );
|
| 817 | PlacementUtils.register(
|
| 818 | context,
|
| 819 | WILDFLOWERS_BIRCH_FOREST,
|
| 820 | wildflower,
|
| 821 | CountPlacement.of(3),
|
| 822 | RarityFilter.onAverageOnceEvery(2),
|
| 823 | InSquarePlacement.spread(),
|
| 824 | PlacementUtils.HEIGHTMAP,
|
| 825 | BiomeFilter.biome(),
|
| 826 | CountPlacement.of(64),
|
| 827 | OffsetPlacement.ofTriangle(6, 2),
|
| 828 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 829 | );
|
| 830 | PlacementUtils.register(
|
| 831 | context,
|
| 832 | WILDFLOWERS_MEADOW,
|
| 833 | wildflower,
|
| 834 | NoiseThresholdCountPlacement.of(-0.8, 5, 10),
|
| 835 | InSquarePlacement.spread(),
|
| 836 | PlacementUtils.HEIGHTMAP,
|
| 837 | BiomeFilter.biome(),
|
| 838 | CountPlacement.of(8),
|
| 839 | OffsetPlacement.ofTriangle(6, 2),
|
| 840 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 841 | );
|
| 842 | PlacementModifier treeThreshold = SurfaceWaterDepthFilter.forMaxDepth(0);
|
| 843 | PlacementUtils.register(
|
| 844 | context,
|
| 845 | TREES_PLAINS,
|
| 846 | treesPlains,
|
| 847 | PlacementUtils.countExtra(0, 0.05F, 1),
|
| 848 | InSquarePlacement.spread(),
|
| 849 | treeThreshold,
|
| 850 | PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
|
| 851 | BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(Blocks.OAK_SAPLING)),
|
| 852 | BiomeFilter.biome()
|
| 853 | );
|
| 854 | PlacementUtils.register(
|
| 855 | context,
|
| 856 | DARK_FOREST_VEGETATION,
|
| 857 | darkForestVegetation,
|
| 858 | CountPlacement.of(16),
|
| 859 | InSquarePlacement.spread(),
|
| 860 | treeThreshold,
|
| 861 | PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
|
| 862 | BiomeFilter.biome()
|
| 863 | );
|
| 864 | PlacementUtils.register(
|
| 865 | context,
|
| 866 | TREES_DAPPLED_FOREST,
|
| 867 | treesDappledForest,
|
| 868 | CountPlacement.of(6),
|
| 869 | InSquarePlacement.spread(),
|
| 870 | treeThreshold,
|
| 871 | PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
|
| 872 | BiomeFilter.biome()
|
| 873 | );
|
| 874 | PlacementUtils.register(
|
| 875 | context,
|
| 876 | PALE_GARDEN_VEGETATION,
|
| 877 | paleGardenVegetation,
|
| 878 | CountPlacement.of(16),
|
| 879 | InSquarePlacement.spread(),
|
| 880 | treeThreshold,
|
| 881 | PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
|
| 882 | BiomeFilter.biome()
|
| 883 | );
|
| 884 | PlacementUtils.register(
|
| 885 | context,
|
| 886 | FLOWER_FOREST_FLOWERS,
|
| 887 | forestFlowers,
|
| 888 | RarityFilter.onAverageOnceEvery(7),
|
| 889 | InSquarePlacement.spread(),
|
| 890 | PlacementUtils.HEIGHTMAP,
|
| 891 | CountPlacement.of(ClampedInt.of(UniformInt.of(-1, 3), 0, 3)),
|
| 892 | BiomeFilter.biome()
|
| 893 | );
|
| 894 | PlacementUtils.register(
|
| 895 | context,
|
| 896 | FOREST_FLOWERS,
|
| 897 | forestFlowers,
|
| 898 | RarityFilter.onAverageOnceEvery(7),
|
| 899 | InSquarePlacement.spread(),
|
| 900 | PlacementUtils.HEIGHTMAP,
|
| 901 | CountPlacement.of(ClampedInt.of(UniformInt.of(-3, 1), 0, 1)),
|
| 902 | BiomeFilter.biome()
|
| 903 | );
|
| 904 | PlacementUtils.register(
|
| 905 | context,
|
| 906 | PALE_GARDEN_FLOWERS,
|
| 907 | paleForestFlower,
|
| 908 | RarityFilter.onAverageOnceEvery(8),
|
| 909 | InSquarePlacement.spread(),
|
| 910 | PlacementUtils.HEIGHTMAP_NO_LEAVES,
|
| 911 | BiomeFilter.biome(),
|
| 912 | CountPlacement.of(96),
|
| 913 | OffsetPlacement.ofTriangle(7, 3),
|
| 914 | BlockPredicateFilter.forPredicate(BlockPredicate.ONLY_IN_AIR_PREDICATE)
|
| 915 | );
|
| 916 | PlacementUtils.register(
|
| 917 | context, PALE_MOSS_PATCH, paleMossPatch, CountPlacement.of(1), InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP_NO_LEAVES, BiomeFilter.biome()
|
| 918 | );
|
| 919 | PlacementUtils.register(context, TREES_FLOWER_FOREST, treesFlowerForest, treePlacement(PlacementUtils.countExtra(6, 0.1F, 1)));
|
| 920 | PlacementUtils.register(context, TREES_MEADOW, meadowTrees, treePlacement(RarityFilter.onAverageOnceEvery(100)));
|
| 921 | PlacementUtils.register(context, TREES_CHERRY, cherryBees005, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1), Blocks.CHERRY_SAPLING));
|
| 922 | PlacementUtils.register(context, TREES_TAIGA, treesTaiga, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
|
| 923 | PlacementUtils.register(context, TREES_GROVE, treesGrove, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
|
| 924 | PlacementUtils.register(context, TREES_BADLANDS, treesBadlands, treePlacement(PlacementUtils.countExtra(5, 0.1F, 1), Blocks.OAK_SAPLING));
|
| 925 | PlacementUtils.register(context, TREES_SNOWY, treesSnowy, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1), Blocks.SPRUCE_SAPLING));
|
| 926 | PlacementUtils.register(
|
| 927 | context,
|
| 928 | TREES_SWAMP,
|
| 929 | swampOak,
|
| 930 | PlacementUtils.countExtra(2, 0.1F, 1),
|
| 931 | InSquarePlacement.spread(),
|
| 932 | SurfaceWaterDepthFilter.forMaxDepth(2),
|
| 933 | PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
|
| 934 | BiomeFilter.biome(),
|
| 935 | BlockPredicateFilter.forPredicate(BlockPredicate.wouldSurvive(Blocks.OAK_SAPLING))
|
| 936 | );
|
| 937 | PlacementUtils.register(context, TREES_WINDSWEPT_SAVANNA, treesSavanna, treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)));
|
| 938 | PlacementUtils.register(context, TREES_SAVANNA, treesSavanna, treePlacement(PlacementUtils.countExtra(1, 0.1F, 1)));
|
| 939 | PlacementUtils.register(context, BIRCH_TALL, birchTall, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
|
| 940 | PlacementUtils.register(context, TREES_BIRCH, treesBirch, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1), Blocks.BIRCH_SAPLING));
|
| 941 | PlacementUtils.register(context, TREES_WINDSWEPT_FOREST, treesWindsweptHills, treePlacement(PlacementUtils.countExtra(3, 0.1F, 1)));
|
| 942 | PlacementUtils.register(context, TREES_WINDSWEPT_HILLS, treesWindsweptHills, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1)));
|
| 943 | PlacementUtils.register(context, TREES_WATER, treesWater, treePlacement(PlacementUtils.countExtra(0, 0.1F, 1)));
|
| 944 | PlacementUtils.register(context, TREES_BIRCH_AND_OAK_LEAF_LITTER, treesBirchAndOakLeafLitter, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
|
| 945 | PlacementUtils.register(context, TREES_SPARSE_JUNGLE, treesSparseJungle, treePlacement(PlacementUtils.countExtra(2, 0.1F, 1)));
|
| 946 | PlacementUtils.register(context, TREES_OLD_GROWTH_SPRUCE_TAIGA, treesOldGrowthSpruceTaiga, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
|
| 947 | PlacementUtils.register(context, TREES_OLD_GROWTH_PINE_TAIGA, treesOldGrowthPineTaiga, treePlacement(PlacementUtils.countExtra(10, 0.1F, 1)));
|
| 948 | PlacementUtils.register(context, TREES_JUNGLE, treesJungle, treePlacement(PlacementUtils.countExtra(50, 0.1F, 1)));
|
| 949 | PlacementUtils.register(context, BAMBOO_VEGETATION, bambooVegetation, treePlacement(PlacementUtils.countExtra(30, 0.1F, 1)));
|
| 950 | PlacementUtils.register(
|
| 951 | context, MUSHROOM_ISLAND_VEGETATION, mushroomIslandVegetation, InSquarePlacement.spread(), PlacementUtils.HEIGHTMAP, BiomeFilter.biome()
|
| 952 | );
|
| 953 | PlacementUtils.register(
|
| 954 | context,
|
| 955 | TREES_MANGROVE,
|
| 956 | mangroveVegetation,
|
| 957 | CountPlacement.of(25),
|
| 958 | InSquarePlacement.spread(),
|
| 959 | SurfaceWaterDepthFilter.forMaxDepth(5),
|
| 960 | PlacementUtils.HEIGHTMAP_OCEAN_FLOOR,
|
| 961 | BiomeFilter.biome()
|
| 962 | );
|
| 963 | }
|
| 964 | }
|
| 965 |
|