diff --git a/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythConfiguredFeatureBootstrap.java b/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythConfiguredFeatureBootstrap.java index d0150524..0c12bee7 100644 --- a/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythConfiguredFeatureBootstrap.java +++ b/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythConfiguredFeatureBootstrap.java @@ -40,12 +40,15 @@ import net.minecraft.world.gen.feature.size.TwoLayersFeatureSize; import net.minecraft.world.gen.foliage.BushFoliagePlacer; import net.minecraft.world.gen.foliage.DarkOakFoliagePlacer; +import net.minecraft.world.gen.foliage.SpruceFoliagePlacer; import net.minecraft.world.gen.placementmodifier.CountPlacementModifier; import net.minecraft.world.gen.placementmodifier.RandomOffsetPlacementModifier; import net.minecraft.world.gen.stateprovider.BlockStateProvider; import net.minecraft.world.gen.stateprovider.RandomizedIntBlockStateProvider; import net.minecraft.world.gen.stateprovider.SimpleBlockStateProvider; import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; +import net.minecraft.world.gen.treedecorator.AlterGroundTreeDecorator; +import net.minecraft.world.gen.trunk.StraightTrunkPlacer; import static moriyashiine.aylyth.common.data.world.feature.AylythConfiguredFeatures.*; @@ -71,8 +74,10 @@ public static void bootstrap(Registerable> context) { var largeGiantJackOLanternMushroomWithPatch = configuredFeatures.getOrThrow(LARGE_GIANT_JACK_O_LANTERN_MUSHROOM_WITH_PATCH); var spruceChecked = placedFeatures.getOrThrow(TreePlacedFeatures.SPRUCE_CHECKED); + var sprucePodzolChecked = placedFeatures.getOrThrow(AylythPlacedFeatures.SPRUCE_PODZOL_CHECKED); var megaSpruceChecked = placedFeatures.getOrThrow(TreePlacedFeatures.MEGA_SPRUCE_CHECKED); var aylythianDarkOak = placedFeatures.getOrThrow(AylythPlacedFeatures.AYLYTHIAN_DARK_OAK); + var aylythianDarkOakPodzol = placedFeatures.getOrThrow(AylythPlacedFeatures.AYLYTHIAN_DARK_OAK_PODZOL); var aylythianMegaDarkOak = placedFeatures.getOrThrow(AylythPlacedFeatures.AYLYTHIAN_MEGA_DARK_OAK); var ympe = placedFeatures.getOrThrow(AylythPlacedFeatures.YMPE_TREE); var bigYmpe = placedFeatures.getOrThrow(AylythPlacedFeatures.BIG_YMPE_TREE); @@ -112,6 +117,16 @@ public static void bootstrap(Registerable> context) { ConfiguredFeatures.register(context, DARK_OAK_SEEP, AylythFeatures.SEEP_FEATURE, new SeepFeature.SeepFeatureConfig(Blocks.DARK_OAK_LOG.getDefaultState(), AylythBlocks.DARK_OAK_SEEP.getDefaultState(), AylythBlocks.MARIGOLD.getDefaultState(), 5, 0.5F)); ConfiguredFeatures.register(context, YMPE_SEEP, AylythFeatures.SEEP_FEATURE, new SeepFeature.SeepFeatureConfig(AylythBlocks.YMPE_LOG.getDefaultState(), AylythBlocks.YMPE_SEEP.getDefaultState(), AylythBlocks.MARIGOLD.getDefaultState(), 5, 0.5F)); + ConfiguredFeatures.register(context, SPRUCE_PODZOL_CHECKED, Feature.TREE, new TreeFeatureConfig.Builder( + BlockStateProvider.of(Blocks.SPRUCE_LOG), + new StraightTrunkPlacer(5, 2, 1), + BlockStateProvider.of(Blocks.SPRUCE_LEAVES), + new SpruceFoliagePlacer(UniformIntProvider.create(2, 3), UniformIntProvider.create(0, 2), UniformIntProvider.create(1, 2)), + new TwoLayersFeatureSize(2, 0, 2)) + .ignoreVines() + .decorators(ImmutableList.of(new AlterGroundTreeDecorator(BlockStateProvider.of(Blocks.MUD)))) // TODO replace with AylythBlocks.DARK_PODZOL + .build() + ); ConfiguredFeatures.register(context, AYLYTHIAN_DARK_OAK, Feature.TREE, new TreeFeatureConfig.Builder( SimpleBlockStateProvider.of(Blocks.DARK_OAK_LOG.getDefaultState()), new AylthianTrunkPlacer(12, 2, 5), @@ -144,6 +159,39 @@ public static void bootstrap(Registerable> context) { 0.1875f ) )).build()); + ConfiguredFeatures.register(context, AYLYTHIAN_DARK_OAK_PODZOL, Feature.TREE, new TreeFeatureConfig.Builder( + SimpleBlockStateProvider.of(Blocks.DARK_OAK_LOG.getDefaultState()), + new AylthianTrunkPlacer(12, 2, 5), + SimpleBlockStateProvider.of(Blocks.DARK_OAK_LEAVES.getDefaultState()), + new DarkOakFoliagePlacer(ConstantIntProvider.create(1), ConstantIntProvider.create(0)), + new TwoLayersFeatureSize(1, 1, 2)) + .ignoreVines() + .decorators(ImmutableList.of( + new AlterGroundTreeDecorator(BlockStateProvider.of(Blocks.MUD)), // TODO replace with AylythBlocks.DARK_PODZOL + new GrapeVineDecorator(UniformIntProvider.create(0, 9), 1), + new PlaceAroundTreeDecorator(RegistryEntryList.of( + RegistryEntry.of(new PlacedFeature(oakStrewnLeavesConfigured, List.of( + CountPlacementModifier.of(UniformIntProvider.create(4, 8)), + RandomOffsetPlacementModifier.horizontally(UniformIntProvider.create(2, 6)), + PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, + PlacedFeatures.wouldSurvive(AylythBlocks.OAK_STREWN_LEAVES) + ))), + RegistryEntry.of(new PlacedFeature(oakLeafPileConfigured, List.of( + CountPlacementModifier.of(UniformIntProvider.create(0, 2)), + RandomOffsetPlacementModifier.horizontally(UniformIntProvider.create(2, 6)), + PlacedFeatures.WORLD_SURFACE_WG_HEIGHTMAP, + PlacedFeatures.wouldSurvive(AylythBlocks.OAK_STREWN_LEAVES) + ))) + )), + new BranchDecorator( + new WeightedBlockStateProvider(DataPool.builder() + .add(AylythBlocks.DARK_OAK_BRANCH.getDefaultState(), 2) + .add(AylythBlocks.BARE_DARK_OAK_BRANCH.getDefaultState(), 4) + .build()), + ConstantIntProvider.create(2), + 0.1875f + ) + )).build()); ConfiguredFeatures.register(context, AYLYTHIAN_MEGA_DARK_OAK, Feature.TREE, new TreeFeatureConfig.Builder( SimpleBlockStateProvider.of(Blocks.DARK_OAK_LOG.getDefaultState()), new AylthianTrunkPlacer(18, 6, 7), @@ -295,9 +343,9 @@ public static void bootstrap(Registerable> context) { ConfiguredFeatures.register(context, DEEP_ROOF_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(aylythianDarkOak, 0.25F)), aylythianMegaDarkOak)); ConfiguredFeatures.register(context, CONIFEROUS_DEEP_ROOF_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(aylythianMegaDarkOak, 0.65F)), megaSpruceChecked)); - ConfiguredFeatures.register(context, COPSE_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.25F)), aylythianDarkOak)); + ConfiguredFeatures.register(context, COPSE_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.25F)), aylythianDarkOakPodzol)); ConfiguredFeatures.register(context, DEEPWOOD_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.25F), new RandomFeatureEntry(bigYmpe, 0.25F)), aylythianDarkOak)); - ConfiguredFeatures.register(context, CONIFEROUS_COPSE_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.25F)), spruceChecked)); + ConfiguredFeatures.register(context, CONIFEROUS_COPSE_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.25F)), sprucePodzolChecked)); ConfiguredFeatures.register(context, CONIFEROUS_DEEPWOOD_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.15F), new RandomFeatureEntry(bigYmpe, 0.15F)), spruceChecked)); ConfiguredFeatures.register(context, OVERGROWTH_CLEARING_TREES,Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(new RandomFeatureEntry(ympe, 0.5F)), spruceChecked)); ConfiguredFeatures.register(context, MIRE_WATER_TREES, Feature.RANDOM_SELECTOR, new RandomFeatureConfig(List.of(), writhewood)); diff --git a/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythPlacedFeatureBootstrap.java b/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythPlacedFeatureBootstrap.java index 3aeb35a1..3ccd9ad8 100644 --- a/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythPlacedFeatureBootstrap.java +++ b/src/datagen/java/moriyashiine/aylyth/datagen/common/world/feature/AylythPlacedFeatureBootstrap.java @@ -27,7 +27,9 @@ private AylythPlacedFeatureBootstrap() {} public static void bootstrap(Registerable context) { var features = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE); + var sprucePodzolChecked = features.getOrThrow(AylythConfiguredFeatures.SPRUCE_PODZOL_CHECKED); var aylythianDarkOak = features.getOrThrow(AylythConfiguredFeatures.AYLYTHIAN_DARK_OAK); + var aylythianDarkOakPodzol = features.getOrThrow(AylythConfiguredFeatures.AYLYTHIAN_DARK_OAK_PODZOL); var aylythianMegaDarkOak = features.getOrThrow(AylythConfiguredFeatures.AYLYTHIAN_MEGA_DARK_OAK); var ympe = features.getOrThrow(AylythConfiguredFeatures.YMPE_TREE); var bigYmpe = features.getOrThrow(AylythConfiguredFeatures.BIG_YMPE_TREE); @@ -76,7 +78,9 @@ public static void bootstrap(Registerable context) { var jackOLanternMushroom = features.getOrThrow(AylythConfiguredFeatures.JACK_O_LANTERN_MUSHROOM); var giantJackOLanternMushrooms = features.getOrThrow(AylythConfiguredFeatures.GIANT_JACK_O_LANTERN_MUSHROOMS); + PlacedFeatures.register(context, SPRUCE_PODZOL_CHECKED, sprucePodzolChecked, List.of(PlacedFeatures.wouldSurvive(Blocks.SPRUCE_SAPLING))); PlacedFeatures.register(context, AYLYTHIAN_DARK_OAK, aylythianDarkOak, List.of(PlacedFeatures.wouldSurvive(Blocks.DARK_OAK_SAPLING))); + PlacedFeatures.register(context, AYLYTHIAN_DARK_OAK_PODZOL, aylythianDarkOakPodzol, List.of(PlacedFeatures.wouldSurvive(Blocks.DARK_OAK_SAPLING))); PlacedFeatures.register(context, AYLYTHIAN_MEGA_DARK_OAK, aylythianMegaDarkOak, List.of(PlacedFeatures.wouldSurvive(Blocks.DARK_OAK_SAPLING))); PlacedFeatures.register(context, YMPE_TREE, ympe, List.of(PlacedFeatures.wouldSurvive(AylythBlocks.YMPE_SAPLING))); PlacedFeatures.register(context, BIG_YMPE_TREE, bigYmpe, List.of(PlacedFeatures.wouldSurvive(AylythBlocks.YMPE_SAPLING))); diff --git a/src/main/generated/data/aylyth/worldgen/configured_feature/aylythian_dark_oak_podzol.json b/src/main/generated/data/aylyth/worldgen/configured_feature/aylythian_dark_oak_podzol.json new file mode 100644 index 00000000..c001962b --- /dev/null +++ b/src/main/generated/data/aylyth/worldgen/configured_feature/aylythian_dark_oak_podzol.json @@ -0,0 +1,189 @@ +{ + "type": "minecraft:tree", + "config": { + "decorators": [ + { + "type": "minecraft:alter_ground", + "provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:mud" + } + } + }, + { + "type": "aylyth:grape_vine", + "chance_point": 1, + "chance_range": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 9, + "min_inclusive": 0 + } + } + }, + { + "type": "aylyth:place_around", + "placed_features": [ + { + "feature": "aylyth:oak_strewn_leaves", + "placement": [ + { + "type": "minecraft:count", + "count": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 8, + "min_inclusive": 4 + } + } + }, + { + "type": "minecraft:random_offset", + "xz_spread": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 6, + "min_inclusive": 2 + } + }, + "y_spread": 0 + }, + { + "type": "minecraft:heightmap", + "heightmap": "WORLD_SURFACE_WG" + }, + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:would_survive", + "state": { + "Name": "aylyth:oak_strewn_leaves", + "Properties": { + "leaves": "0" + } + } + } + } + ] + }, + { + "feature": "aylyth:oak_leaf_pile", + "placement": [ + { + "type": "minecraft:count", + "count": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 2, + "min_inclusive": 0 + } + } + }, + { + "type": "minecraft:random_offset", + "xz_spread": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 6, + "min_inclusive": 2 + } + }, + "y_spread": 0 + }, + { + "type": "minecraft:heightmap", + "heightmap": "WORLD_SURFACE_WG" + }, + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:would_survive", + "state": { + "Name": "aylyth:oak_strewn_leaves", + "Properties": { + "leaves": "0" + } + } + } + } + ] + } + ] + }, + { + "type": "aylyth:branches", + "block_state": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "aylyth:dark_oak_branch", + "Properties": { + "facing": "north" + } + }, + "weight": 2 + }, + { + "data": { + "Name": "aylyth:bare_dark_oak_branch", + "Properties": { + "facing": "north" + } + }, + "weight": 4 + } + ] + }, + "chance": 0.1875, + "min_branch_height": 2 + } + ], + "dirt_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:dirt" + } + }, + "foliage_placer": { + "type": "minecraft:dark_oak_foliage_placer", + "offset": 0, + "radius": 1 + }, + "foliage_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:dark_oak_leaves", + "Properties": { + "distance": "7", + "persistent": "false", + "waterlogged": "false" + } + } + }, + "force_dirt": false, + "ignore_vines": true, + "minimum_size": { + "type": "minecraft:two_layers_feature_size", + "limit": 1, + "lower_size": 1, + "upper_size": 2 + }, + "trunk_placer": { + "type": "aylyth:aylythian", + "base_height": 12, + "height_rand_a": 2, + "height_rand_b": 5 + }, + "trunk_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:dark_oak_log", + "Properties": { + "axis": "y" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/generated/data/aylyth/worldgen/configured_feature/coniferous_copse_trees.json b/src/main/generated/data/aylyth/worldgen/configured_feature/coniferous_copse_trees.json index 77b5657e..56fa1206 100644 --- a/src/main/generated/data/aylyth/worldgen/configured_feature/coniferous_copse_trees.json +++ b/src/main/generated/data/aylyth/worldgen/configured_feature/coniferous_copse_trees.json @@ -1,7 +1,7 @@ { "type": "minecraft:random_selector", "config": { - "default": "minecraft:spruce_checked", + "default": "aylyth:spruce_podzol_checked", "features": [ { "chance": 0.25, diff --git a/src/main/generated/data/aylyth/worldgen/configured_feature/copse_trees.json b/src/main/generated/data/aylyth/worldgen/configured_feature/copse_trees.json index 498ff1e9..d6086d46 100644 --- a/src/main/generated/data/aylyth/worldgen/configured_feature/copse_trees.json +++ b/src/main/generated/data/aylyth/worldgen/configured_feature/copse_trees.json @@ -1,7 +1,7 @@ { "type": "minecraft:random_selector", "config": { - "default": "aylyth:aylythian_dark_oak", + "default": "aylyth:aylythian_dark_oak_podzol", "features": [ { "chance": 0.25, diff --git a/src/main/generated/data/aylyth/worldgen/configured_feature/spruce_podzol_checked.json b/src/main/generated/data/aylyth/worldgen/configured_feature/spruce_podzol_checked.json new file mode 100644 index 00000000..a146786e --- /dev/null +++ b/src/main/generated/data/aylyth/worldgen/configured_feature/spruce_podzol_checked.json @@ -0,0 +1,80 @@ +{ + "type": "minecraft:tree", + "config": { + "decorators": [ + { + "type": "minecraft:alter_ground", + "provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:mud" + } + } + } + ], + "dirt_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:dirt" + } + }, + "foliage_placer": { + "type": "minecraft:spruce_foliage_placer", + "offset": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 2, + "min_inclusive": 0 + } + }, + "radius": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 3, + "min_inclusive": 2 + } + }, + "trunk_height": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 2, + "min_inclusive": 1 + } + } + }, + "foliage_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:spruce_leaves", + "Properties": { + "distance": "7", + "persistent": "false", + "waterlogged": "false" + } + } + }, + "force_dirt": false, + "ignore_vines": true, + "minimum_size": { + "type": "minecraft:two_layers_feature_size", + "limit": 2, + "lower_size": 0, + "upper_size": 2 + }, + "trunk_placer": { + "type": "minecraft:straight_trunk_placer", + "base_height": 5, + "height_rand_a": 2, + "height_rand_b": 1 + }, + "trunk_provider": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "minecraft:spruce_log", + "Properties": { + "axis": "y" + } + } + } + } +} \ No newline at end of file diff --git a/src/main/generated/data/aylyth/worldgen/placed_feature/aylythian_dark_oak_podzol.json b/src/main/generated/data/aylyth/worldgen/placed_feature/aylythian_dark_oak_podzol.json new file mode 100644 index 00000000..23b077cd --- /dev/null +++ b/src/main/generated/data/aylyth/worldgen/placed_feature/aylythian_dark_oak_podzol.json @@ -0,0 +1,17 @@ +{ + "feature": "aylyth:aylythian_dark_oak_podzol", + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:would_survive", + "state": { + "Name": "minecraft:dark_oak_sapling", + "Properties": { + "stage": "0" + } + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/generated/data/aylyth/worldgen/placed_feature/spruce_podzol_checked.json b/src/main/generated/data/aylyth/worldgen/placed_feature/spruce_podzol_checked.json new file mode 100644 index 00000000..454032ea --- /dev/null +++ b/src/main/generated/data/aylyth/worldgen/placed_feature/spruce_podzol_checked.json @@ -0,0 +1,17 @@ +{ + "feature": "aylyth:spruce_podzol_checked", + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:would_survive", + "state": { + "Name": "minecraft:spruce_sapling", + "Properties": { + "stage": "0" + } + } + } + } + ] +} \ No newline at end of file diff --git a/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythConfiguredFeatures.java b/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythConfiguredFeatures.java index bee61f18..ae2206b6 100644 --- a/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythConfiguredFeatures.java +++ b/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythConfiguredFeatures.java @@ -7,7 +7,9 @@ public interface AylythConfiguredFeatures { + RegistryKey> SPRUCE_PODZOL_CHECKED = bind("spruce_podzol_checked"); RegistryKey> AYLYTHIAN_DARK_OAK = bind("aylythian_dark_oak"); + RegistryKey> AYLYTHIAN_DARK_OAK_PODZOL = bind("aylythian_dark_oak_podzol"); RegistryKey> AYLYTHIAN_MEGA_DARK_OAK = bind("aylythian_mega_dark_oak"); RegistryKey> YMPE_TREE = bind("ympe_tree"); RegistryKey> BIG_YMPE_TREE = bind("big_ympe_tree"); diff --git a/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythPlacedFeatures.java b/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythPlacedFeatures.java index 4733bdac..a8550089 100644 --- a/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythPlacedFeatures.java +++ b/src/main/java/moriyashiine/aylyth/common/data/world/feature/AylythPlacedFeatures.java @@ -7,7 +7,9 @@ public interface AylythPlacedFeatures { + RegistryKey SPRUCE_PODZOL_CHECKED = bind("spruce_podzol_checked"); RegistryKey AYLYTHIAN_DARK_OAK = bind("aylythian_dark_oak"); + RegistryKey AYLYTHIAN_DARK_OAK_PODZOL = bind("aylythian_dark_oak_podzol"); RegistryKey AYLYTHIAN_MEGA_DARK_OAK = bind("aylythian_mega_dark_oak"); RegistryKey YMPE_TREE = bind("ympe_tree"); RegistryKey BIG_YMPE_TREE = bind("big_ympe_tree");