diff --git a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 index 00a389f80..8e26b02ae 100644 --- a/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 +++ b/src/generated/resources/.cache/103d9f3f36b01595f1aa5172191e60eff02e6924 @@ -20,7 +20,7 @@ c8ded336a053628e3d1b703205e22bdab82e45ed data/deeperdarker/worldgen/configured_c 48bb30a772e7c76763d21c73a8c50465232d0ce1 data/deeperdarker/worldgen/configured_carver/low_cave.json 7a40f8a13100f7860d8cb263f4384985ae7c06ef data/deeperdarker/worldgen/configured_feature/blooming_sculk_patch.json 97ed3584ea072e20778c14293a3c7723cd17e590 data/deeperdarker/worldgen/configured_feature/blooming_sculk_vegetation.json -5097028f5c8ae5e294126d6df771e3126d4fbd07 data/deeperdarker/worldgen/configured_feature/gloomslate_column.json +2a58a7fc9fa2442b7c1f06b43210f06a7c3a7e85 data/deeperdarker/worldgen/configured_feature/gloomslate_column.json ba29dfa84f2bebe688044c6e89b6c1d38dbaf0c6 data/deeperdarker/worldgen/configured_feature/gloomslate_generation.json 3f567c5127afb1df2660808a6487f862a94e9a0f data/deeperdarker/worldgen/configured_feature/gloomy_sculk_patch.json 091c066d3e288c08e5d68a8aca7b3fb0e6e5639b data/deeperdarker/worldgen/configured_feature/gloomy_sculk_vegetation.json @@ -57,7 +57,7 @@ fc53b26d9b7805848d81c20fdc426b2fbad6ef7b data/deeperdarker/worldgen/configured_f c3cadcbe56faf51699411c61418e62470e8f6d20 data/deeperdarker/worldgen/configured_feature/sculk_decoration.json 96f3ef8cd15afedd3241978ed2b2db5e16a3201b data/deeperdarker/worldgen/configured_feature/sculk_gleam_extra.json 6cb0cb910352cdcc5d68c63401374a6c2384871f data/deeperdarker/worldgen/configured_feature/sculk_patch.json -4a9c3c5f442a6521267b9667441f8388507a893b data/deeperdarker/worldgen/configured_feature/sculk_stone_column.json +2bc34aa95322b1e7f1f54af1ee9faebbd7412885 data/deeperdarker/worldgen/configured_feature/sculk_stone_column.json ee40c6672e01f7903cbd018effd3b9fb238b9dc8 data/deeperdarker/worldgen/configured_feature/sculk_stone_generation.json 86da19b821a39e48a2b5e372c22674a76caee69a data/deeperdarker/worldgen/configured_feature/sculk_tendrils.json 19ccfc43ca3b12473f3c09eccf4628e21a92b454 data/deeperdarker/worldgen/configured_feature/sculk_vines.json @@ -65,7 +65,7 @@ ee40c6672e01f7903cbd018effd3b9fb238b9dc8 data/deeperdarker/worldgen/configured_f 701e77f912010dc9c4e69b27d70464f27055b504 data/deeperdarker/worldgen/configured_feature/surface_sculk_stone.json 559869d2e75897fc342a5ce4e13bc6a1864c189d data/deeperdarker/worldgen/configured_feature/tree_echo.json 333ebc366d7e8a080a71cde8f67a83af1f4daa8a data/deeperdarker/worldgen/configured_feature/water_edge_blooming.json -8c5ca4b878dc35e7594e4aea2e31c49276a63328 data/deeperdarker/worldgen/noise_settings/otherside.json +c7afaaec2673ebacca18346132ad25008799155c data/deeperdarker/worldgen/noise_settings/otherside.json 34fb9a5e22128132e9fb0b0a7700008873e4ac41 data/deeperdarker/worldgen/placed_feature/blooming_moss.json 86e9199652b2f2b45db99b8aba845e0c841ee88c data/deeperdarker/worldgen/placed_feature/blooming_plant.json 7a014f12c936a2ce55cd0df3b6e7d66934996c63 data/deeperdarker/worldgen/placed_feature/blooming_pool.json @@ -74,7 +74,7 @@ fe37fcf58645ddec579c794a106fbcff6e32c041 data/deeperdarker/worldgen/placed_featu cc0ab13e199295089d8269584cc7aa83b3595c9b data/deeperdarker/worldgen/placed_feature/echo_soil.json e18687e9b7d94385510ea85e00af1ba4e24e32ec data/deeperdarker/worldgen/placed_feature/echo_tree.json 739dfb25c8e5de7a098ca0c9a256cc28d890e63c data/deeperdarker/worldgen/placed_feature/gloomslate_coal.json -a3e77b78f6eba14f152f3741fe1cb1a8d1c69a8d data/deeperdarker/worldgen/placed_feature/gloomslate_column.json +341d6d68c4048bcaef96b310d1305f5972393def data/deeperdarker/worldgen/placed_feature/gloomslate_column.json ec749b07053226a5e16dbb8d3e5edd32cd222ba1 data/deeperdarker/worldgen/placed_feature/gloomslate_copper.json 0686ede689680c5287b98008af9f5875dbbece6f data/deeperdarker/worldgen/placed_feature/gloomslate_diamond.json 7fea9d60ef7fb72a20a81a83fdd16324680a97a5 data/deeperdarker/worldgen/placed_feature/gloomslate_emerald.json @@ -102,7 +102,7 @@ a670a7b1571536e9bd6efb3f8af754889ade09b0 data/deeperdarker/worldgen/placed_featu 25ccb921d6aacc892bac6798d7100bb80eebc8d0 data/deeperdarker/worldgen/placed_feature/sculk_jaw.json 947212897a389e4e4c38c7764e8791e68ea002b9 data/deeperdarker/worldgen/placed_feature/sculk_lapis.json ce21acbb6c41dff7c5c2484ad56ae38328ab8bc4 data/deeperdarker/worldgen/placed_feature/sculk_redstone.json -9e7b0e834e64b10028033879a82f3ecc70cea008 data/deeperdarker/worldgen/placed_feature/sculk_stone_column.json +9efcdb262bb4fad355f27ba824655be6734ced51 data/deeperdarker/worldgen/placed_feature/sculk_stone_column.json 1c8848dc3a0abc0e5f314c553e13232ddd42dbc1 data/deeperdarker/worldgen/placed_feature/sculk_tendrils.json 937a0b115c2368339f410eddb37cc6747e0453a9 data/deeperdarker/worldgen/placed_feature/sculk_vines.json b76ec202988b0b3d258ab73fe3f480253e5da1c7 data/deeperdarker/worldgen/placed_feature/sculk_vines_caverns.json diff --git a/src/generated/resources/.cache/2b1c4c301b77a741c666834d476e7a049e70d3df b/src/generated/resources/.cache/2b1c4c301b77a741c666834d476e7a049e70d3df index 83483c409..224767ffa 100644 --- a/src/generated/resources/.cache/2b1c4c301b77a741c666834d476e7a049e70d3df +++ b/src/generated/resources/.cache/2b1c4c301b77a741c666834d476e7a049e70d3df @@ -1,4 +1,4 @@ -// 1.21 2024-08-04T12:12:17.7582845 Tags for minecraft:block mod id deeperdarker +// 1.21 2024-09-27T16:44:43.3285872 Tags for minecraft:block mod id deeperdarker 9d236ad52ffab14efb6405a34d837dafff77e363 data/c/tags/block/ores.json ec4e45d46ce1593f9bb4b226a1e3d143bc0942c6 data/c/tags/block/ores/coal.json dc2be5311ef04baad7565936ffafc6dcea324cf1 data/c/tags/block/ores/copper.json @@ -11,12 +11,16 @@ b87f41ec93385cf003a9e81713446620acd52b86 data/c/tags/block/ores/redstone.json d88fb43be0304b77c90c64f924fa2b46c4eeea4a data/c/tags/block/stones.json 4def6c04349da9777fc48313256495659524feb1 data/deeperdarker/tags/block/blooming_pool_replaceable.json 7d44281ae960cc3804e46c4d7ae2b88440d7a7cf data/deeperdarker/tags/block/bloom_stems.json +26c6e382ee88aa5ceb2dbc3be3407d577055645a data/deeperdarker/tags/block/deeplands_column_base.json +95e1d3134e9669f8c331d9f9eb08f17c742dd1e6 data/deeperdarker/tags/block/deeplands_column_replaceable.json 3254a070f3d679712b15610724ab74c5900e0204 data/deeperdarker/tags/block/echo_logs.json 5fc75620cbf33b6fbe8762687116de2f0df1bd34 data/deeperdarker/tags/block/gloomslate_replaceable.json 1b524a72db2dc423a915068148fa9e921f2e46f5 data/deeperdarker/tags/block/gloomy_sculk_replaceable.json ac89124de10dcfff814aa1d073803cec2f9bc838 data/deeperdarker/tags/block/glowing_vine_placeable.json 8578e12406e1c266232a54a95ac849d05041d948 data/deeperdarker/tags/block/infiniburn_otherside.json 16fc775f3d68d0ec1accc58f8fcfd10c571706ad data/deeperdarker/tags/block/otherside_carver_replaceables.json +8abb1d7af65db4bb0406045cba4bca15fbbaa133 data/deeperdarker/tags/block/overcast_column_base.json +5fc75620cbf33b6fbe8762687116de2f0df1bd34 data/deeperdarker/tags/block/overcast_column_replaceable.json 4b3a3834715a617924c94f9d91ae043b2f4c9d63 data/deeperdarker/tags/block/sculk_replaceables.json a602a7264c375269e61c0ace10abfad2a27444f0 data/deeperdarker/tags/block/sculk_stone_replaceables.json 603846420eb6d91e94f6409e765348644b6f95bb data/deeperdarker/tags/block/sculk_vine_placeable.json diff --git a/src/generated/resources/data/deeperdarker/tags/block/deeplands_column_base.json b/src/generated/resources/data/deeperdarker/tags/block/deeplands_column_base.json new file mode 100644 index 000000000..672d6e14b --- /dev/null +++ b/src/generated/resources/data/deeperdarker/tags/block/deeplands_column_base.json @@ -0,0 +1,9 @@ +{ + "values": [ + "#c:ores", + "minecraft:sculk", + "deeperdarker:sculk_stone", + "deeperdarker:sculk_grime", + "deeperdarker:infested_sculk" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/deeperdarker/tags/block/deeplands_column_replaceable.json b/src/generated/resources/data/deeperdarker/tags/block/deeplands_column_replaceable.json new file mode 100644 index 000000000..923be957b --- /dev/null +++ b/src/generated/resources/data/deeperdarker/tags/block/deeplands_column_replaceable.json @@ -0,0 +1,6 @@ +{ + "values": [ + "minecraft:sculk", + "deeperdarker:infested_sculk" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/deeperdarker/tags/block/overcast_column_base.json b/src/generated/resources/data/deeperdarker/tags/block/overcast_column_base.json new file mode 100644 index 000000000..caaecf7cd --- /dev/null +++ b/src/generated/resources/data/deeperdarker/tags/block/overcast_column_base.json @@ -0,0 +1,10 @@ +{ + "values": [ + "#c:ores", + "minecraft:magma_block", + "minecraft:soul_sand", + "minecraft:soul_soil", + "deeperdarker:gloomy_sculk", + "deeperdarker:gloomslate" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/deeperdarker/tags/block/overcast_column_replaceable.json b/src/generated/resources/data/deeperdarker/tags/block/overcast_column_replaceable.json new file mode 100644 index 000000000..bd0e88b50 --- /dev/null +++ b/src/generated/resources/data/deeperdarker/tags/block/overcast_column_replaceable.json @@ -0,0 +1,6 @@ +{ + "values": [ + "deeperdarker:gloomy_sculk", + "deeperdarker:gloomy_geyser" + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/deeperdarker/worldgen/configured_feature/gloomslate_column.json b/src/generated/resources/data/deeperdarker/worldgen/configured_feature/gloomslate_column.json index 1ac7668f1..cdbcbed55 100644 --- a/src/generated/resources/data/deeperdarker/worldgen/configured_feature/gloomslate_column.json +++ b/src/generated/resources/data/deeperdarker/worldgen/configured_feature/gloomslate_column.json @@ -1,4 +1,17 @@ { - "type": "deeperdarker:gloomslate_column", - "config": {} + "type": "deeperdarker:otherside_column", + "config": { + "baseReplaceable": "deeperdarker:overcast_column_replaceable", + "block": { + "Name": "deeperdarker:gloomslate" + }, + "columnBase": "deeperdarker:overcast_column_base", + "incompleteChance": 0.333, + "middleBlock": { + "Name": "deeperdarker:crystallized_amber", + "Properties": { + "fossilized": "false" + } + } + } } \ No newline at end of file diff --git a/src/generated/resources/data/deeperdarker/worldgen/configured_feature/sculk_stone_column.json b/src/generated/resources/data/deeperdarker/worldgen/configured_feature/sculk_stone_column.json index 375c8aa76..6754113fc 100644 --- a/src/generated/resources/data/deeperdarker/worldgen/configured_feature/sculk_stone_column.json +++ b/src/generated/resources/data/deeperdarker/worldgen/configured_feature/sculk_stone_column.json @@ -1,4 +1,14 @@ { - "type": "deeperdarker:sculk_stone_column", - "config": {} + "type": "deeperdarker:otherside_column", + "config": { + "baseReplaceable": "deeperdarker:deeplands_column_replaceable", + "block": { + "Name": "deeperdarker:sculk_stone" + }, + "columnBase": "deeperdarker:deeplands_column_base", + "incompleteChance": 0.1, + "middleBlock": { + "Name": "deeperdarker:sculk_stone" + } + } } \ No newline at end of file diff --git a/src/generated/resources/data/deeperdarker/worldgen/noise_settings/otherside.json b/src/generated/resources/data/deeperdarker/worldgen/noise_settings/otherside.json index 6f3f9d664..e609ec12d 100644 --- a/src/generated/resources/data/deeperdarker/worldgen/noise_settings/otherside.json +++ b/src/generated/resources/data/deeperdarker/worldgen/noise_settings/otherside.json @@ -12,7 +12,7 @@ "height": 128, "min_y": 0, "size_horizontal": 1, - "size_vertical": 2 + "size_vertical": 1 }, "noise_router": { "barrier": 0.0, @@ -42,23 +42,24 @@ }, "argument2": { "type": "minecraft:add", - "argument1": -2.5, + "argument1": -1.4, "argument2": { - "type": "minecraft:add", - "argument1": 1.1, + "type": "minecraft:mul", + "argument1": { + "type": "minecraft:y_clamped_gradient", + "from_value": 1.0, + "from_y": 104, + "to_value": 0.0, + "to_y": 128 + }, "argument2": { - "type": "minecraft:mul", - "argument1": { - "type": "minecraft:y_clamped_gradient", - "from_value": 1.0, - "from_y": 104, - "to_value": 0.0, - "to_y": 128 - }, + "type": "minecraft:add", + "argument1": -0.85, "argument2": { - "type": "minecraft:add", - "argument1": -0.85, - "argument2": "minecraft:nether/base_3d_noise" + "type": "minecraft:noise", + "noise": "minecraft:gravel", + "xz_scale": 4.0, + "y_scale": 9.0 } } } diff --git a/src/generated/resources/data/deeperdarker/worldgen/placed_feature/gloomslate_column.json b/src/generated/resources/data/deeperdarker/worldgen/placed_feature/gloomslate_column.json index d73098000..db677f583 100644 --- a/src/generated/resources/data/deeperdarker/worldgen/placed_feature/gloomslate_column.json +++ b/src/generated/resources/data/deeperdarker/worldgen/placed_feature/gloomslate_column.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:count", - "count": 24 + "count": 12 }, { "type": "minecraft:in_square" diff --git a/src/generated/resources/data/deeperdarker/worldgen/placed_feature/sculk_stone_column.json b/src/generated/resources/data/deeperdarker/worldgen/placed_feature/sculk_stone_column.json index aef504a77..7488d9b7c 100644 --- a/src/generated/resources/data/deeperdarker/worldgen/placed_feature/sculk_stone_column.json +++ b/src/generated/resources/data/deeperdarker/worldgen/placed_feature/sculk_stone_column.json @@ -3,7 +3,7 @@ "placement": [ { "type": "minecraft:count", - "count": 14 + "count": 6 }, { "type": "minecraft:in_square" diff --git a/src/main/java/com/kyanite/deeperdarker/datagen/data/DDBlockTagsProvider.java b/src/main/java/com/kyanite/deeperdarker/datagen/data/DDBlockTagsProvider.java index 1eca940b3..952241d33 100644 --- a/src/main/java/com/kyanite/deeperdarker/datagen/data/DDBlockTagsProvider.java +++ b/src/main/java/com/kyanite/deeperdarker/datagen/data/DDBlockTagsProvider.java @@ -102,14 +102,22 @@ protected void addTags(HolderLookup.@NotNull Provider provider) { tag(DDTags.Blocks.ECHO_LOGS).add(DDBlocks.ECHO_LOG.get(), DDBlocks.ECHO_WOOD.get(), DDBlocks.STRIPPED_ECHO_LOG.get(), DDBlocks.STRIPPED_ECHO_WOOD.get()); tag(DDTags.Blocks.BLOOM_STEMS).add(DDBlocks.BLOOMING_STEM.get(), DDBlocks.STRIPPED_BLOOMING_STEM.get()); + tag(DDTags.Blocks.OTHERSIDE_CARVER_REPLACEABLES).add(Blocks.WATER, Blocks.DEEPSLATE, Blocks.SCULK, DDBlocks.SCULK_STONE.get(), DDBlocks.SCULK_GRIME.get(), DDBlocks.GLOOMSLATE.get(), DDBlocks.GLOOMY_SCULK.get(), DDBlocks.BLOOMING_SCULK_STONE.get(), DDBlocks.BLOOMING_MOSS_BLOCK.get()); tag(DDTags.Blocks.SCULK_STONE_REPLACEABLES).add(DDBlocks.SCULK_STONE.get(), DDBlocks.SCULK_GRIME.get()); tag(DDTags.Blocks.SCULK_REPLACEABLES).add(Blocks.SCULK, DDBlocks.SCULK_GRIME.get()); + tag(DDTags.Blocks.DEEPLANDS_COLUMN_REPLACEABLE).add(Blocks.SCULK, DDBlocks.INFESTED_SCULK.get()); + tag(DDTags.Blocks.DEEPLANDS_COLUMN_BASE).addTag(Tags.Blocks.ORES).add(Blocks.SCULK, DDBlocks.SCULK_STONE.get(), DDBlocks.SCULK_GRIME.get(), DDBlocks.INFESTED_SCULK.get()); + tag(DDTags.Blocks.GLOOMSLATE_REPLACEABLE).add(DDBlocks.GLOOMY_SCULK.get(), DDBlocks.GLOOMY_GEYSER.get()); tag(DDTags.Blocks.GLOOMY_SCULK_REPLACEABLE).add(Blocks.SCULK, DDBlocks.SCULK_STONE.get(), DDBlocks.GLOOMSLATE.get(), DDBlocks.SCULK_GRIME.get(), DDBlocks.ECHO_SOIL.get(), DDBlocks.GLOOMY_SCULK.get()); + tag(DDTags.Blocks.OVERCAST_COLUMN_REPLACEABLE).add(DDBlocks.GLOOMY_SCULK.get(), DDBlocks.GLOOMY_GEYSER.get()); + tag(DDTags.Blocks.OVERCAST_COLUMN_BASE).addTag(Tags.Blocks.ORES).add(Blocks.MAGMA_BLOCK, Blocks.SOUL_SAND, Blocks.SOUL_SOIL, DDBlocks.GLOOMY_SCULK.get(), DDBlocks.GLOOMSLATE.get()); + tag(DDTags.Blocks.BLOOMING_POOL_REPLACEABLE).add(DDBlocks.BLOOMING_SCULK_STONE.get(), DDBlocks.BLOOMING_MOSS_BLOCK.get()); tag(DDTags.Blocks.SCULK_VINE_PLACEABLE).add(Blocks.SCULK, DDBlocks.SCULK_STONE.get(), DDBlocks.ECHO_LEAVES.get()); tag(DDTags.Blocks.GLOWING_VINE_PLACEABLE).add(Blocks.SCULK, DDBlocks.SCULK_STONE.get()); + tag(DDTags.Blocks.TRANSMITTABLE).addTags(BlockTags.SHULKER_BOXES, BlockTags.ANVIL).add(Blocks.CRAFTING_TABLE, Blocks.STONECUTTER, Blocks.CARTOGRAPHY_TABLE, Blocks.SMITHING_TABLE, Blocks.GRINDSTONE, Blocks.LOOM, Blocks.FURNACE, Blocks.SMOKER, Blocks.BLAST_FURNACE, Blocks.CHIPPED_ANVIL, Blocks.ENCHANTING_TABLE, Blocks.BREWING_STAND, Blocks.BEACON, Blocks.CHEST, Blocks.BARREL, Blocks.DISPENSER, Blocks.DROPPER, Blocks.HOPPER, Blocks.TRAPPED_CHEST); tag(DDTags.Blocks.INFINIBURN_OTHERSIDE).addTag(BlockTags.INFINIBURN_NETHER).add(DDBlocks.GLOOMSLATE.get()); } diff --git a/src/main/java/com/kyanite/deeperdarker/util/DDTags.java b/src/main/java/com/kyanite/deeperdarker/util/DDTags.java index 1dca7f7e4..bd750a150 100644 --- a/src/main/java/com/kyanite/deeperdarker/util/DDTags.java +++ b/src/main/java/com/kyanite/deeperdarker/util/DDTags.java @@ -21,8 +21,14 @@ public static class Blocks { public static final TagKey OTHERSIDE_CARVER_REPLACEABLES = tag("otherside_carver_replaceables"); public static final TagKey SCULK_STONE_REPLACEABLES = tag("sculk_stone_replaceables"); public static final TagKey SCULK_REPLACEABLES = tag("sculk_replaceables"); + public static final TagKey DEEPLANDS_COLUMN_REPLACEABLE = tag("deeplands_column_replaceable"); + public static final TagKey DEEPLANDS_COLUMN_BASE = tag("deeplands_column_base"); + public static final TagKey GLOOMSLATE_REPLACEABLE = tag("gloomslate_replaceable"); public static final TagKey GLOOMY_SCULK_REPLACEABLE = tag("gloomy_sculk_replaceable"); + public static final TagKey OVERCAST_COLUMN_REPLACEABLE = tag("overcast_column_replaceable"); + public static final TagKey OVERCAST_COLUMN_BASE = tag("overcast_column_base"); + public static final TagKey BLOOMING_POOL_REPLACEABLE = tag("blooming_pool_replaceable"); public static final TagKey SCULK_VINE_PLACEABLE = tag("sculk_vine_placeable"); diff --git a/src/main/java/com/kyanite/deeperdarker/world/DDConfiguredFeatures.java b/src/main/java/com/kyanite/deeperdarker/world/DDConfiguredFeatures.java index 181c06db5..e551d9f77 100644 --- a/src/main/java/com/kyanite/deeperdarker/world/DDConfiguredFeatures.java +++ b/src/main/java/com/kyanite/deeperdarker/world/DDConfiguredFeatures.java @@ -3,6 +3,7 @@ import com.kyanite.deeperdarker.DeeperDarker; import com.kyanite.deeperdarker.content.DDBlocks; import com.kyanite.deeperdarker.util.DDTags; +import com.kyanite.deeperdarker.world.features.config.ColumnFeatureConfiguration; import com.kyanite.deeperdarker.world.features.config.VineFeatureConfiguration; import net.minecraft.core.Direction; import net.minecraft.core.HolderGetter; @@ -112,8 +113,8 @@ public static void bootstrap(BootstrapContext> context) List soulSoilTarget = List.of(OreConfiguration.target(sculkGrime, Blocks.SOUL_SOIL.defaultBlockState())); List magmaTarget = List.of(OreConfiguration.target(sculkGrime, Blocks.MAGMA_BLOCK.defaultBlockState())); - FeatureUtils.register(context, SCULK_STONE_COLUMN, DDFeatures.SCULK_STONE_COLUMN.get()); - FeatureUtils.register(context, GLOOMSLATE_COLUMN, DDFeatures.GLOOMSLATE_COLUMN.get()); + FeatureUtils.register(context, SCULK_STONE_COLUMN, DDFeatures.OTHERSIDE_COLUMN.get(), new ColumnFeatureConfiguration(DDBlocks.SCULK_STONE.get().defaultBlockState(), DDBlocks.SCULK_STONE.get().defaultBlockState(), DDTags.Blocks.DEEPLANDS_COLUMN_BASE, DDTags.Blocks.DEEPLANDS_COLUMN_REPLACEABLE, 0.1f)); + FeatureUtils.register(context, GLOOMSLATE_COLUMN, DDFeatures.OTHERSIDE_COLUMN.get(), new ColumnFeatureConfiguration(DDBlocks.GLOOMSLATE.get().defaultBlockState(), DDBlocks.CRYSTALLIZED_AMBER.get().defaultBlockState(), DDTags.Blocks.OVERCAST_COLUMN_BASE, DDTags.Blocks.OVERCAST_COLUMN_REPLACEABLE, 0.333f)); FeatureUtils.register(context, SCULK_GLEAM_EXTRA, DDFeatures.SCULK_GLEAM_BLOB.get()); FeatureUtils.register(context, SCULK_TENDRILS, DDFeatures.SCULK_TENDRILS.get()); FeatureUtils.register(context, SCULK_VINES, DDFeatures.VINE.get(), new VineFeatureConfiguration(DDBlocks.SCULK_VINES_PLANT.get().defaultBlockState(), DDBlocks.SCULK_VINES.get().defaultBlockState(), DDTags.Blocks.SCULK_VINE_PLACEABLE, UniformInt.of(1, 8), 0.2f, 0.25f)); diff --git a/src/main/java/com/kyanite/deeperdarker/world/DDFeatures.java b/src/main/java/com/kyanite/deeperdarker/world/DDFeatures.java index 13ae9158e..060ff0c42 100644 --- a/src/main/java/com/kyanite/deeperdarker/world/DDFeatures.java +++ b/src/main/java/com/kyanite/deeperdarker/world/DDFeatures.java @@ -2,6 +2,7 @@ import com.kyanite.deeperdarker.DeeperDarker; import com.kyanite.deeperdarker.world.features.*; +import com.kyanite.deeperdarker.world.features.config.ColumnFeatureConfiguration; import com.kyanite.deeperdarker.world.features.config.VineFeatureConfiguration; import net.minecraft.core.registries.Registries; import net.minecraft.world.level.levelgen.feature.Feature; @@ -13,9 +14,7 @@ public class DDFeatures { public static final DeferredRegister> FEATURES = DeferredRegister.create(Registries.FEATURE, DeeperDarker.MOD_ID); public static final DeferredHolder, VineFeature> VINE = FEATURES.register("vine", () -> new VineFeature(VineFeatureConfiguration.CODEC)); - - public static final DeferredHolder, SculkStoneColumnFeature> SCULK_STONE_COLUMN = FEATURES.register("sculk_stone_column", () -> new SculkStoneColumnFeature(NoneFeatureConfiguration.CODEC)); - public static final DeferredHolder, GloomslateColumnFeature> GLOOMSLATE_COLUMN = FEATURES.register("gloomslate_column", () -> new GloomslateColumnFeature(NoneFeatureConfiguration.CODEC)); + public static final DeferredHolder, OthersideColumnFeature> OTHERSIDE_COLUMN = FEATURES.register("otherside_column", () -> new OthersideColumnFeature(ColumnFeatureConfiguration.CODEC)); public static final DeferredHolder, SculkGleamFeature> SCULK_GLEAM_BLOB = FEATURES.register("sculk_gleam_blob", () -> new SculkGleamFeature(NoneFeatureConfiguration.CODEC)); public static final DeferredHolder, SculkTendrilsFeature> SCULK_TENDRILS = FEATURES.register("sculk_tendrils", () -> new SculkTendrilsFeature(NoneFeatureConfiguration.CODEC)); public static final DeferredHolder, GlowingRootsFeature> GLOWING_ROOTS = FEATURES.register("glowing_roots", () -> new GlowingRootsFeature(NoneFeatureConfiguration.CODEC)); diff --git a/src/main/java/com/kyanite/deeperdarker/world/DDPlacedFeatures.java b/src/main/java/com/kyanite/deeperdarker/world/DDPlacedFeatures.java index 72bfc7325..8b5bffc6c 100644 --- a/src/main/java/com/kyanite/deeperdarker/world/DDPlacedFeatures.java +++ b/src/main/java/com/kyanite/deeperdarker/world/DDPlacedFeatures.java @@ -71,8 +71,8 @@ public class DDPlacedFeatures { public static void bootstrap(BootstrapContext context) { HolderGetter> features = context.lookup(Registries.CONFIGURED_FEATURE); - PlacementUtils.register(context, SCULK_STONE_COLUMN, features.getOrThrow(DDConfiguredFeatures.SCULK_STONE_COLUMN), countPlacement(14, PlacementUtils.FULL_RANGE)); - PlacementUtils.register(context, GLOOMSLATE_COLUMN, features.getOrThrow(DDConfiguredFeatures.GLOOMSLATE_COLUMN), countPlacement(24, PlacementUtils.FULL_RANGE)); + PlacementUtils.register(context, SCULK_STONE_COLUMN, features.getOrThrow(DDConfiguredFeatures.SCULK_STONE_COLUMN), countPlacement(6, PlacementUtils.FULL_RANGE)); + PlacementUtils.register(context, GLOOMSLATE_COLUMN, features.getOrThrow(DDConfiguredFeatures.GLOOMSLATE_COLUMN), countPlacement(12, PlacementUtils.FULL_RANGE)); PlacementUtils.register(context, SCULK_GLEAM, features.getOrThrow(DDConfiguredFeatures.SCULK_GLEAM_EXTRA), countPlacement(16, PlacementUtils.FULL_RANGE)); PlacementUtils.register(context, SCULK_GLEAM_FOREST, features.getOrThrow(DDConfiguredFeatures.SCULK_GLEAM_EXTRA), countPlacement(28, PlacementUtils.FULL_RANGE)); PlacementUtils.register(context, SCULK_TENDRILS, features.getOrThrow(DDConfiguredFeatures.SCULK_TENDRILS), countPlacement(36, PlacementUtils.FULL_RANGE)); diff --git a/src/main/java/com/kyanite/deeperdarker/world/features/GloomslateColumnFeature.java b/src/main/java/com/kyanite/deeperdarker/world/features/GloomslateColumnFeature.java deleted file mode 100644 index 39cbdaf9a..000000000 --- a/src/main/java/com/kyanite/deeperdarker/world/features/GloomslateColumnFeature.java +++ /dev/null @@ -1,153 +0,0 @@ -package com.kyanite.deeperdarker.world.features; - -import com.kyanite.deeperdarker.content.DDBlocks; -import com.kyanite.deeperdarker.content.blocks.CrystallizedAmberBlock; -import com.kyanite.deeperdarker.content.blocks.entity.CrystallizedAmberBlockEntity; -import com.mojang.serialization.Codec; -import net.minecraft.core.BlockPos; -import net.minecraft.util.RandomSource; -import net.minecraft.util.valueproviders.BiasedToBottomInt; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.levelgen.feature.Feature; -import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; -import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; - -public class GloomslateColumnFeature extends Feature { - public GloomslateColumnFeature(Codec codec) { - super(codec); - } - - @Override - public boolean place(FeaturePlaceContext context) { - WorldGenLevel level = context.level(); - BlockPos origin = context.origin(); - RandomSource random = context.random(); - - int columnHeight = 0; - BlockPos.MutableBlockPos blockPos = origin.mutable(); - while(level.getBlockState(blockPos).isAir()) { - columnHeight++; - blockPos.move(0, 1, 0); - } - - if(anyObstruction(level, origin, columnHeight)) return false; - if(!level.getBlockState(origin.below()).is(DDBlocks.GLOOMY_SCULK.get())) return false; - level.setBlock(origin.below(), DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - level.setBlock(origin.above(columnHeight), DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - - int amberLength = (int) (columnHeight * 0.35f); - int gapSize = 0; - boolean incomplete = random.nextFloat() < 0.333f; - if(amberLength > 9) gapSize = BiasedToBottomInt.of(2, amberLength - 7).sample(random); - int gapStart = (amberLength - gapSize) / 2; - int gapPlacement = 0; - - blockPos = origin.mutable(); - for(int i = 1; i < columnHeight + 1; i++) { - float percentageToTop = i / ((float) columnHeight + 1); - - if(percentageToTop >= 0.325f && percentageToTop <= 0.675f) { - if(amberLength < 7) level.setBlock(blockPos, DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - else if(amberLength > 9 && incomplete) { - if(gapPlacement < gapStart || gapPlacement > gapStart + gapSize) level.setBlock(blockPos, DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - gapPlacement++; - } else { - boolean fossil = random.nextFloat() < 0.4f; - BlockState amber = DDBlocks.CRYSTALLIZED_AMBER.get().defaultBlockState(); - level.setBlock(blockPos, fossil ? amber.setValue(CrystallizedAmberBlock.FOSSILIZED, true) : amber, 3); - if(fossil && level.getBlockEntity(blockPos) instanceof CrystallizedAmberBlockEntity blockEntity) blockEntity.generateFossil(level.getLevel(), blockPos); - } - } else if(amberLength > 6 && !incomplete && percentageToTop >= 0.3f && percentageToTop <= 0.7f) { - level.setBlock(blockPos, DDBlocks.GLOOMY_SCULK.get().defaultBlockState(), 3); - } else { - level.setBlock(blockPos, DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - } - - blockPos.move(0, 1, 0); - } - - double multiplier = amberLength < 7 ? 1.2 : amberLength > 9 && incomplete ? 0.92 : 1; - columnBase(level, random, origin, columnHeight, multiplier, true); - columnBase(level, random, origin.above(columnHeight - 1), columnHeight, multiplier, false); - - return true; - } - - private boolean anyObstruction(WorldGenLevel level, BlockPos pos, int distance) { - for(int i = 0; i < distance; i++) { - if(!level.getBlockState(pos.above(i)).is(Blocks.AIR)) return true; - } - - return false; - } - - private void columnBase(WorldGenLevel level, RandomSource random, BlockPos origin, int columnHeight, double multiplier, boolean bottom) { - for(int i = 0; i < 4; i++) { - int baseHeight = random.nextInt((int) (0.36 * columnHeight * multiplier), (int) (0.41 * columnHeight * multiplier) + 1); - placeSection(level, random, origin, baseHeight, i, 1, multiplier, bottom); - stretchToFloor(level, origin, i, 1, bottom); - } - - for(int i = 0; i < 8; i++) { - double baseHeight = random.nextInt((int) (0.22 * columnHeight), (int) (0.26 * columnHeight) + 1); - if(i > 3) baseHeight *= 0.67; - placeSection(level, random, origin, baseHeight, i, 2, multiplier, bottom); - stretchToFloor(level, origin, i, 2, bottom); - } - - if(multiplier > 1) return; - for(int i = 0; i < 8; i++) { - int baseHeight = random.nextInt((int) (0.04 * columnHeight), (int) (0.08 * columnHeight) + 1); - placeSection(level, random, origin, baseHeight, i, 3, multiplier, bottom); - stretchToFloor(level, origin, i, 3, bottom); - } - } - - private void placeSection(WorldGenLevel level, RandomSource random, BlockPos pos, double baseHeight, int iteration, int loop, double multiplier, boolean bottom) { - float p = random.nextFloat(); - for(int j = 0; j < baseHeight; j++) { - BlockPos location = spread(bottom ? pos.above(j) : pos.below(j), iteration, loop); - - if(iteration > 3 && multiplier > 1) return; - if(j == baseHeight - 2 && j != 0 && p < 0.1f) level.setBlock(location, DDBlocks.GLOOMY_SCULK.get().defaultBlockState(), 3); - else if(j == baseHeight - 1 && j != 0 && p < 0.22f) level.setBlock(location, DDBlocks.GLOOMY_SCULK.get().defaultBlockState(), 3); - else level.setBlock(location, DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - } - } - - private BlockPos spread(BlockPos pos, int index, int loop) { - BlockPos basePos = pos; - for(int i = 0; i < loop; i++) { - int j = i % 2; - if(index > 3 && loop == 2 && i == 0) j++; - else if(index > 3 && i != 1) j += 2; - switch ((index + j) % 4) { - default -> basePos = basePos.north(); - case 1 -> basePos = basePos.east(); - case 2 -> basePos = basePos.south(); - case 3 -> basePos = basePos.west(); - } - } - - return basePos; - } - - private void stretchToFloor(WorldGenLevel level, BlockPos pos, int i, int loop, boolean bottom) { - BlockPos blockPos = spread(bottom ? pos.below() : pos.above(), i, loop); - - if(bottom) { - while(!level.getBlockState(blockPos).is(DDBlocks.SCULK_STONE.get()) && !level.getBlockState(blockPos).is(DDBlocks.GLOOMSLATE.get()) && !level.getBlockState(blockPos).is(Blocks.DEEPSLATE) && !level.isOutsideBuildHeight(blockPos)) { - level.setBlock(blockPos, DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - blockPos = blockPos.below(); - } - return; - } - - while(!level.getBlockState(blockPos).is(DDBlocks.SCULK_STONE.get()) && !level.getBlockState(blockPos).is(DDBlocks.GLOOMY_SCULK.get()) && !level.getBlockState(blockPos).is(DDBlocks.GLOOMSLATE.get()) && !level.getBlockState(blockPos).is(Blocks.DEEPSLATE) && !level.isOutsideBuildHeight(blockPos)) { - level.setBlock(blockPos, DDBlocks.GLOOMSLATE.get().defaultBlockState(), 3); - blockPos = blockPos.above(); - } - } -} diff --git a/src/main/java/com/kyanite/deeperdarker/world/features/OthersideColumnFeature.java b/src/main/java/com/kyanite/deeperdarker/world/features/OthersideColumnFeature.java new file mode 100644 index 000000000..2335790a8 --- /dev/null +++ b/src/main/java/com/kyanite/deeperdarker/world/features/OthersideColumnFeature.java @@ -0,0 +1,146 @@ +package com.kyanite.deeperdarker.world.features; + +import com.kyanite.deeperdarker.content.DDBlocks; +import com.kyanite.deeperdarker.content.blocks.CrystallizedAmberBlock; +import com.kyanite.deeperdarker.content.blocks.entity.CrystallizedAmberBlockEntity; +import com.kyanite.deeperdarker.world.features.config.ColumnFeatureConfiguration; +import com.mojang.serialization.Codec; +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.util.RandomSource; +import net.minecraft.world.level.WorldGenLevel; +import net.minecraft.world.level.block.state.BlockBehaviour; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.levelgen.Column; +import net.minecraft.world.level.levelgen.feature.Feature; +import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; + +import java.util.Optional; + +public class OthersideColumnFeature extends Feature { + public OthersideColumnFeature(Codec codec) { + super(codec); + } + + @Override + public boolean place(FeaturePlaceContext context) { + ColumnFeatureConfiguration config = context.config(); + WorldGenLevel level = context.level(); + BlockPos origin = context.origin(); + RandomSource random = context.random(); + + if(!level.getBlockState(origin).isAir()) return false; + Optional scan = Column.scan(level, origin, 64, BlockBehaviour.BlockStateBase::isAir, blockState -> !blockState.isAir()); + if(scan.isEmpty() || !(scan.get() instanceof Column.Range column)) return false; + if(column.height() < 7) return false; + if(!level.getBlockState(origin.atY(column.floor())).is(config.columnBase()) || !level.getBlockState(origin.atY(column.ceiling())).is(config.columnBase())) return false; + + for(int x = -2; x <= 2; x++) { + for(int z = -2; z <= 2; z++) { + if(x == 0 && z == 0) continue; + + BlockPos.MutableBlockPos pos = new BlockPos.MutableBlockPos(origin.getX() + x, column.floor(), origin.getZ() + z); + boolean air = level.getBlockState(pos).isAir(); + if(checkUnevenBase(config, level, pos, air, air ? Direction.DOWN : Direction.UP)) return false; + + pos.setY(column.ceiling()); + air = level.getBlockState(pos).isAir(); + if(checkUnevenBase(config, level, pos, air, air ? Direction.UP : Direction.DOWN)) return false; + } + } + + boolean incomplete = random.nextFloat() < config.incompleteChance(); + boolean middle = !incomplete && random.nextFloat() < 0.5f; + for(int i = column.floor() + 1; i < column.ceiling(); i++) { + if(incomplete && i - column.floor() > column.height() * 2 / 5.0 + 2 && i - column.floor() < 3 * column.height() / 5.0 - 2) continue; + + BlockPos pos = origin.atY(i); + if(middle && i - column.floor() >= column.height() / 3.0 && i - column.floor() <= 2 * column.height() / 3.0 + 1) { + BlockState state = config.middleBlock(); + boolean fossil = state.is(DDBlocks.CRYSTALLIZED_AMBER) && random.nextFloat() < 0.4f; + + level.setBlock(pos, fossil ? state.setValue(CrystallizedAmberBlock.FOSSILIZED, true) : state, 3); + if(fossil && level.getBlockEntity(pos) instanceof CrystallizedAmberBlockEntity blockEntity) blockEntity.generateFossil(level.getLevel(), pos); + } else { + level.setBlock(pos, config.block(), 3); + } + } + + double multiplier = column.height() < 20 ? 1.2 : 1; + for(Direction direction : Direction.Plane.HORIZONTAL) { + int height1 = random.nextInt((int) (column.height() / 3.0 * multiplier), (int) (column.height() / 2.5 * multiplier) + 1); + int height2 = random.nextInt((int) (0.62 * height1), (int) (0.69 * height1) + 1); + int height3 = random.nextInt((int) (0.41 * height1), (int) (0.48 * height1) + 1); + int height4 = random.nextInt((int) (0.1 * height1), (int) (0.22 * height1) + 1); + + for(int i = 1; i <= height1; i++) { + BlockPos pos = origin.atY(column.floor() + i).relative(direction); + placeSection(config, level, direction, height2, height3, height4, i, pos, Direction.DOWN); + } + + height1 = random.nextInt((int) (column.height() / 3.0 * multiplier), (int) (column.height() / 2.5 * multiplier) + 1); + height2 = random.nextInt((int) (0.62 * height1), (int) (0.69 * height1) + 1); + height3 = random.nextInt((int) (0.41 * height1), (int) (0.48 * height1) + 1); + height4 = random.nextInt((int) (0.1 * height1), (int) (0.22 * height1) + 1); + + for(int i = height1; i > 0; i--) { + BlockPos pos = origin.atY(column.ceiling() - i).relative(direction); + placeSection(config, level, direction, height2, height3, height4, i, pos, Direction.UP); + } + } + + return true; + } + + public static boolean checkUnevenBase(ColumnFeatureConfiguration config, WorldGenLevel level, BlockPos.MutableBlockPos pos, boolean air, Direction direction) { + int heightDiff = 0; + BlockPos comparePos = air ? pos : pos.relative(direction); + + while(level.getBlockState(comparePos).isAir() == air) { + pos.move(direction); + comparePos = air ? pos : pos.relative(direction); + heightDiff++; + if(heightDiff > 4) return true; + } + + return !level.getBlockState(pos).is(config.columnBase()); + } + + private void placeSection(ColumnFeatureConfiguration config, WorldGenLevel level, Direction direction, int height2, int height3, int height4, int i, BlockPos pos, Direction stretchDirection) { + level.setBlock(pos, config.block(), 3); + if(i > height2) return; + + level.setBlock(pos.relative(direction.getClockWise()), config.block(), 3); + if(i > height3) return; + + if(i == 1) { + stretchToTerrain(config, level, pos, stretchDirection); + stretchToTerrain(config, level, pos.relative(direction.getClockWise()), stretchDirection); + } + + pos = pos.relative(direction); + if(i == 1) { + stretchToTerrain(config, level, pos, stretchDirection); + stretchToTerrain(config, level, pos.relative(direction.getClockWise()), stretchDirection); + stretchToTerrain(config, level, pos.relative(direction.getCounterClockWise()), stretchDirection); + } + + level.setBlock(pos, config.block(), 3); + if(i > height4) return; + + level.setBlock(pos.relative(direction.getClockWise()), config.block(), 3); + level.setBlock(pos.relative(direction.getCounterClockWise()), config.block(), 3); + } + + private void stretchToTerrain(ColumnFeatureConfiguration config, WorldGenLevel level, BlockPos pos, Direction direction) { + BlockPos.MutableBlockPos pos2 = pos.relative(direction).mutable(); + while((level.getBlockState(pos2).isAir() || level.getBlockState(pos2).is(config.baseReplaceable())) && pos2.getY() > level.getMinBuildHeight() && pos2.getY() < level.getMaxBuildHeight()) { + if(level.getBlockState(pos2).is(config.baseReplaceable())) { + level.setBlock(pos2, config.block(), 3); + break; + } + level.setBlock(pos2, config.block(), 3); + pos2.move(direction); + } + } +} diff --git a/src/main/java/com/kyanite/deeperdarker/world/features/SculkStoneColumnFeature.java b/src/main/java/com/kyanite/deeperdarker/world/features/SculkStoneColumnFeature.java deleted file mode 100644 index ffe21a0ab..000000000 --- a/src/main/java/com/kyanite/deeperdarker/world/features/SculkStoneColumnFeature.java +++ /dev/null @@ -1,124 +0,0 @@ -package com.kyanite.deeperdarker.world.features; - -import com.kyanite.deeperdarker.content.DDBlocks; -import com.mojang.serialization.Codec; -import net.minecraft.core.BlockPos; -import net.minecraft.util.RandomSource; -import net.minecraft.world.level.WorldGenLevel; -import net.minecraft.world.level.block.Blocks; -import net.minecraft.world.level.levelgen.feature.Feature; -import net.minecraft.world.level.levelgen.feature.FeaturePlaceContext; -import net.minecraft.world.level.levelgen.feature.configurations.NoneFeatureConfiguration; - -public class SculkStoneColumnFeature extends Feature { - public SculkStoneColumnFeature(Codec codec) { - super(codec); - } - - @Override - public boolean place(FeaturePlaceContext context) { - WorldGenLevel level = context.level(); - BlockPos origin = context.origin(); - RandomSource random = context.random(); - - int columnHeight = 0; - BlockPos.MutableBlockPos blockPos = origin.mutable(); - while(level.getBlockState(blockPos).isAir()) { - columnHeight++; - blockPos.move(0, 1, 0); - } - - if(anyObstruction(level, origin, columnHeight)) return false; - if(!level.getBlockState(origin.below()).is(Blocks.SCULK)) return false; - level.setBlock(origin.below(), DDBlocks.SCULK_STONE.get().defaultBlockState(), 3); - level.setBlock(origin.above(columnHeight), DDBlocks.SCULK_STONE.get().defaultBlockState(), 3); - - blockPos = origin.mutable(); - for(int i = 1; i < columnHeight + 1; i++) { - level.setBlock(blockPos, DDBlocks.SCULK_STONE.get().defaultBlockState(), 3); - blockPos.move(0, 1, 0); - } - - double multiplier = columnHeight * 0.35f < 7 ? 1.2 : 1; - columnBase(level, random, origin, columnHeight, multiplier, true); - columnBase(level, random, origin.above(columnHeight - 1), columnHeight, multiplier, false); - - return true; - } - - private boolean anyObstruction(WorldGenLevel level, BlockPos pos, int distance) { - for(int i = 0; i < distance; i++) { - if(!level.getBlockState(pos.above(i)).is(Blocks.AIR)) return true; - } - - return false; - } - - private void columnBase(WorldGenLevel level, RandomSource random, BlockPos origin, int columnHeight, double multiplier, boolean bottom) { - for(int i = 0; i < 4; i++) { - int baseHeight = random.nextInt((int) (0.36 * columnHeight * multiplier), (int) (0.41 * columnHeight * multiplier) + 1); - placeSection(level, random, origin, baseHeight, i, 1, multiplier, bottom); - stretchToFloor(level, origin, i, 1, bottom); - } - - for(int i = 0; i < 8; i++) { - double baseHeight = random.nextInt((int) (0.22 * columnHeight), (int) (0.26 * columnHeight) + 1); - if(i > 3) baseHeight *= 0.67; - placeSection(level, random, origin, baseHeight, i, 2, multiplier, bottom); - stretchToFloor(level, origin, i, 2, bottom); - } - - if(multiplier > 1) return; - for(int i = 0; i < 8; i++) { - int baseHeight = random.nextInt((int) (0.04 * columnHeight), (int) (0.08 * columnHeight) + 1); - placeSection(level, random, origin, baseHeight, i, 3, multiplier, bottom); - stretchToFloor(level, origin, i, 3, bottom); - } - } - - private void placeSection(WorldGenLevel level, RandomSource random, BlockPos pos, double baseHeight, int iteration, int loop, double multiplier, boolean bottom) { - float p = random.nextFloat(); - for(int j = 0; j < baseHeight; j++) { - BlockPos location = spread(bottom ? pos.above(j) : pos.below(j), iteration, loop); - - if(iteration > 3 && multiplier > 1) return; - if(j == baseHeight - 2 && j != 0 && p < 0.1f) level.setBlock(location, Blocks.SCULK.defaultBlockState(), 3); - else if(j == baseHeight - 1 && j != 0 && p < 0.22f) level.setBlock(location, Blocks.SCULK.defaultBlockState(), 3); - else level.setBlock(location, DDBlocks.SCULK_STONE.get().defaultBlockState(), 3); - } - } - - private BlockPos spread(BlockPos pos, int index, int loop) { - BlockPos basePos = pos; - for(int i = 0; i < loop; i++) { - int j = i % 2; - if(index > 3 && loop == 2 && i == 0) j++; - else if(index > 3 && i != 1) j += 2; - switch ((index + j) % 4) { - default -> basePos = basePos.north(); - case 1 -> basePos = basePos.east(); - case 2 -> basePos = basePos.south(); - case 3 -> basePos = basePos.west(); - } - } - - return basePos; - } - - private void stretchToFloor(WorldGenLevel level, BlockPos pos, int i, int loop, boolean bottom) { - BlockPos blockPos = spread(bottom ? pos.below() : pos.above(), i, loop); - - if(bottom) { - while(!level.getBlockState(blockPos).is(DDBlocks.SCULK_STONE.get()) && !level.getBlockState(blockPos).is(Blocks.DEEPSLATE) && !level.isOutsideBuildHeight(blockPos)) { - level.setBlock(blockPos, DDBlocks.SCULK_STONE.get().defaultBlockState(), 3); - blockPos = blockPos.below(); - } - return; - } - - while(!level.getBlockState(blockPos).is(Blocks.SCULK) && !level.getBlockState(blockPos).is(DDBlocks.SCULK_STONE.get()) && !level.getBlockState(blockPos).is(Blocks.DEEPSLATE) && !level.isOutsideBuildHeight(blockPos)) { - level.setBlock(blockPos, DDBlocks.SCULK_STONE.get().defaultBlockState(), 3); - blockPos = blockPos.above(); - } - } -} diff --git a/src/main/java/com/kyanite/deeperdarker/world/features/config/ColumnFeatureConfiguration.java b/src/main/java/com/kyanite/deeperdarker/world/features/config/ColumnFeatureConfiguration.java new file mode 100644 index 000000000..988f1476b --- /dev/null +++ b/src/main/java/com/kyanite/deeperdarker/world/features/config/ColumnFeatureConfiguration.java @@ -0,0 +1,51 @@ +package com.kyanite.deeperdarker.world.features.config; + +import com.mojang.serialization.Codec; +import com.mojang.serialization.codecs.RecordCodecBuilder; +import net.minecraft.core.registries.Registries; +import net.minecraft.tags.TagKey; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.levelgen.feature.configurations.FeatureConfiguration; + +public class ColumnFeatureConfiguration implements FeatureConfiguration { + public static final Codec CODEC = RecordCodecBuilder.create(config -> config.group( + BlockState.CODEC.fieldOf("block").forGetter(f -> f.block), + BlockState.CODEC.fieldOf("middleBlock").forGetter(f -> f.middleBlock), + TagKey.codec(Registries.BLOCK).fieldOf("columnBase").forGetter(f -> f.columnBase), + TagKey.codec(Registries.BLOCK).fieldOf("baseReplaceable").forGetter(f -> f.baseReplaceable), + Codec.floatRange(0f, 1f).fieldOf("incompleteChance").forGetter(f -> f.incompleteChance)).apply(config, ColumnFeatureConfiguration::new)); + private final BlockState block; + private final BlockState middleBlock; + private final TagKey columnBase; + private final TagKey baseReplaceable; + private final float incompleteChance; + + public ColumnFeatureConfiguration(BlockState state, BlockState middleState, TagKey columnBase, TagKey baseReplaceable, float incompleteChance) { + this.block = state; + this.middleBlock = middleState; + this.columnBase = columnBase; + this.baseReplaceable = baseReplaceable; + this.incompleteChance = incompleteChance; + } + + public BlockState block() { + return block; + } + + public BlockState middleBlock() { + return middleBlock; + } + + public TagKey columnBase() { + return columnBase; + } + + public TagKey baseReplaceable() { + return baseReplaceable; + } + + public float incompleteChance() { + return incompleteChance; + } +} diff --git a/src/main/java/com/kyanite/deeperdarker/world/otherside/gen/OthersideGeneration.java b/src/main/java/com/kyanite/deeperdarker/world/otherside/gen/OthersideGeneration.java index 9186beb2d..831a99526 100644 --- a/src/main/java/com/kyanite/deeperdarker/world/otherside/gen/OthersideGeneration.java +++ b/src/main/java/com/kyanite/deeperdarker/world/otherside/gen/OthersideGeneration.java @@ -63,6 +63,6 @@ private static NoiseGeneratorSettings noiseSettings(HolderGetter density, Holde DensityFunction temperature = DensityFunctions.shiftedNoise2d(shiftX, shiftZ, 2.5, noise.getOrThrow(Noises.TEMPERATURE)); DensityFunction vegetation = DensityFunctions.shiftedNoise2d(shiftX, shiftZ, 0.6, noise.getOrThrow(Noises.VEGETATION)); - DensityFunction nether3D = new DensityFunctions.HolderHolder(density.getOrThrow(NoiseRouterData.BASE_3D_NOISE_NETHER)); DensityFunction finalDensity = DensityFunctions.mul( DensityFunctions.constant(0.64), DensityFunctions.interpolated(DensityFunctions.blendDensity(DensityFunctions.add( @@ -19,15 +18,12 @@ public static NoiseRouter otherside(HolderGetter density, Holde DensityFunctions.mul( DensityFunctions.yClampedGradient(-8, 15, 0, 1), DensityFunctions.add( - DensityFunctions.constant(-2.5), - DensityFunctions.add( - DensityFunctions.constant(1.1), - DensityFunctions.mul( - DensityFunctions.yClampedGradient(104, 128, 1, 0), - DensityFunctions.add( - DensityFunctions.constant(-0.85), - nether3D - ) + DensityFunctions.constant(-1.4), + DensityFunctions.mul( + DensityFunctions.yClampedGradient(104, 128, 1, 0), + DensityFunctions.add( + DensityFunctions.constant(-0.85), + DensityFunctions.noise(noise.getOrThrow(Noises.GRAVEL), 4, 9) ) ) ) diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index ef7ffe903..2f69b170d 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -1,4 +1,3 @@ public net.minecraft.world.item.SmithingTemplateItem createNetheriteUpgradeIconList()Ljava/util/List; public net.minecraft.world.level.levelgen.NoiseRouterData SHIFT_X public net.minecraft.world.level.levelgen.NoiseRouterData SHIFT_Z -public net.minecraft.world.level.levelgen.NoiseRouterData BASE_3D_NOISE_NETHER