From 52930951da045f1d7baeb83b6950522d67e24c50 Mon Sep 17 00:00:00 2001 From: Fox Date: Tue, 20 Aug 2024 22:35:30 +0200 Subject: [PATCH] fix salt ore generation --- .../add_deepslate_salt_ore.json | 6 +++ .../biome_modifier/add_end_salt_ore.json | 6 +++ .../biome_modifier/add_nether_salt_ore.json | 6 +++ .../forge/biome_modifier/add_salt_ore.json | 6 +++ .../deepslate_salt_ore.json | 18 +++++++ .../configured_feature/end_salt_ore.json | 18 +++++++ .../configured_feature/nether_salt_ore.json | 18 +++++++ .../worldgen/configured_feature/salt_ore.json | 18 +++++++ .../deepslate_salt_ore_placed.json | 27 ++++++++++ .../placed_feature/end_salt_ore_placed.json | 27 ++++++++++ .../nether_salt_ore_placed.json | 27 ++++++++++ .../placed_feature/salt_ore_placed.json | 27 ++++++++++ .../GrowthcraftCoreDataGenerators.java | 4 +- .../GrowthcraftCoreWorldGenProvider.java | 32 ++++++++++++ .../core/world/GrowthcraftBiomeModifiers.java | 50 +++++++++++++++++++ .../world/GrowthcraftConfiguredFeatures.java | 16 +++--- .../core/world/GrowthcraftPlacedFeatures.java | 38 ++++++++++---- .../salt_ore_old.json} | 0 .../configured_feature/salt_ore_end_old.json} | 2 +- .../salt_ore_nether_old.json} | 2 +- .../configured_feature/salt_ore_old.json} | 2 +- .../placed_feature/salt_ore_placed_old.json} | 0 22 files changed, 327 insertions(+), 23 deletions(-) create mode 100644 src/generated/resources/data/growthcraft/forge/biome_modifier/add_deepslate_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/forge/biome_modifier/add_end_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/forge/biome_modifier/add_nether_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/forge/biome_modifier/add_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/configured_feature/deepslate_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/configured_feature/end_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/configured_feature/nether_salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/placed_feature/deepslate_salt_ore_placed.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/placed_feature/end_salt_ore_placed.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/placed_feature/nether_salt_ore_placed.json create mode 100644 src/generated/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.json create mode 100644 src/main/java/growthcraft/core/datagen/providers/GrowthcraftCoreWorldGenProvider.java create mode 100644 src/main/java/growthcraft/core/world/GrowthcraftBiomeModifiers.java rename src/main/resources/data/growthcraft/forge/{biome_modifier/salt_ore.json => biome_modifier_old/salt_ore_old.json} (100%) rename src/main/resources/data/growthcraft/{worldgen/configured_feature/salt_ore_end.json => worldgen_old/configured_feature/salt_ore_end_old.json} (86%) rename src/main/resources/data/growthcraft/{worldgen/configured_feature/salt_ore_nether.json => worldgen_old/configured_feature/salt_ore_nether_old.json} (86%) rename src/main/resources/data/growthcraft/{worldgen/configured_feature/salt_ore.json => worldgen_old/configured_feature/salt_ore_old.json} (91%) rename src/main/resources/data/growthcraft/{worldgen/placed_feature/salt_ore_placed.json => worldgen_old/placed_feature/salt_ore_placed_old.json} (100%) diff --git a/src/generated/resources/data/growthcraft/forge/biome_modifier/add_deepslate_salt_ore.json b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_deepslate_salt_ore.json new file mode 100644 index 00000000..f302ae51 --- /dev/null +++ b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_deepslate_salt_ore.json @@ -0,0 +1,6 @@ +{ + "type": "forge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "growthcraft:deepslate_salt_ore_placed", + "step": "underground_ores" +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/forge/biome_modifier/add_end_salt_ore.json b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_end_salt_ore.json new file mode 100644 index 00000000..e5bfa081 --- /dev/null +++ b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_end_salt_ore.json @@ -0,0 +1,6 @@ +{ + "type": "forge:add_features", + "biomes": "#minecraft:is_end", + "features": "growthcraft:end_salt_ore_placed", + "step": "underground_ores" +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/forge/biome_modifier/add_nether_salt_ore.json b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_nether_salt_ore.json new file mode 100644 index 00000000..9f856079 --- /dev/null +++ b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_nether_salt_ore.json @@ -0,0 +1,6 @@ +{ + "type": "forge:add_features", + "biomes": "#minecraft:is_nether", + "features": "growthcraft:nether_salt_ore_placed", + "step": "underground_ores" +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/forge/biome_modifier/add_salt_ore.json b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_salt_ore.json new file mode 100644 index 00000000..b38d5957 --- /dev/null +++ b/src/generated/resources/data/growthcraft/forge/biome_modifier/add_salt_ore.json @@ -0,0 +1,6 @@ +{ + "type": "forge:add_features", + "biomes": "#minecraft:is_overworld", + "features": "growthcraft:salt_ore_placed", + "step": "underground_ores" +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/configured_feature/deepslate_salt_ore.json b/src/generated/resources/data/growthcraft/worldgen/configured_feature/deepslate_salt_ore.json new file mode 100644 index 00000000..8a77c0dc --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/configured_feature/deepslate_salt_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 5, + "targets": [ + { + "state": { + "Name": "growthcraft:salt_ore_deepslate" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:deepslate_ore_replaceables" + } + } + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/configured_feature/end_salt_ore.json b/src/generated/resources/data/growthcraft/worldgen/configured_feature/end_salt_ore.json new file mode 100644 index 00000000..328d06fc --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/configured_feature/end_salt_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 5, + "targets": [ + { + "state": { + "Name": "growthcraft:salt_ore_end" + }, + "target": { + "block": "minecraft:end_stone", + "predicate_type": "minecraft:block_match" + } + } + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/configured_feature/nether_salt_ore.json b/src/generated/resources/data/growthcraft/worldgen/configured_feature/nether_salt_ore.json new file mode 100644 index 00000000..00ae06a7 --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/configured_feature/nether_salt_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 5, + "targets": [ + { + "state": { + "Name": "growthcraft:salt_ore_nether" + }, + "target": { + "block": "minecraft:netherrack", + "predicate_type": "minecraft:block_match" + } + } + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json b/src/generated/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json new file mode 100644 index 00000000..874aadcd --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json @@ -0,0 +1,18 @@ +{ + "type": "minecraft:ore", + "config": { + "discard_chance_on_air_exposure": 0.0, + "size": 5, + "targets": [ + { + "state": { + "Name": "growthcraft:salt_ore" + }, + "target": { + "predicate_type": "minecraft:tag_match", + "tag": "minecraft:stone_ore_replaceables" + } + } + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/placed_feature/deepslate_salt_ore_placed.json b/src/generated/resources/data/growthcraft/worldgen/placed_feature/deepslate_salt_ore_placed.json new file mode 100644 index 00000000..2c4341da --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/placed_feature/deepslate_salt_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "growthcraft:deepslate_salt_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 50 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 64 + }, + "min_inclusive": { + "absolute": -32 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/placed_feature/end_salt_ore_placed.json b/src/generated/resources/data/growthcraft/worldgen/placed_feature/end_salt_ore_placed.json new file mode 100644 index 00000000..7441c9c5 --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/placed_feature/end_salt_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "growthcraft:end_salt_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 50 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 64 + }, + "min_inclusive": { + "absolute": -32 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/placed_feature/nether_salt_ore_placed.json b/src/generated/resources/data/growthcraft/worldgen/placed_feature/nether_salt_ore_placed.json new file mode 100644 index 00000000..dc347320 --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/placed_feature/nether_salt_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "growthcraft:nether_salt_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 50 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 64 + }, + "min_inclusive": { + "absolute": -32 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/generated/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.json b/src/generated/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.json new file mode 100644 index 00000000..398d9737 --- /dev/null +++ b/src/generated/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.json @@ -0,0 +1,27 @@ +{ + "feature": "growthcraft:salt_ore", + "placement": [ + { + "type": "minecraft:count", + "count": 10 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:height_range", + "height": { + "type": "minecraft:uniform", + "max_inclusive": { + "absolute": 64 + }, + "min_inclusive": { + "absolute": -32 + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/src/main/java/growthcraft/core/datagen/GrowthcraftCoreDataGenerators.java b/src/main/java/growthcraft/core/datagen/GrowthcraftCoreDataGenerators.java index 26eae4ec..45669eb0 100644 --- a/src/main/java/growthcraft/core/datagen/GrowthcraftCoreDataGenerators.java +++ b/src/main/java/growthcraft/core/datagen/GrowthcraftCoreDataGenerators.java @@ -7,6 +7,7 @@ import growthcraft.core.datagen.providers.GrowthcraftCoreItemTags; import growthcraft.core.datagen.providers.GrowthcraftCoreLootTableProvider; import growthcraft.core.datagen.providers.GrowthcraftCoreRecipes; +import growthcraft.core.datagen.providers.GrowthcraftCoreWorldGenProvider; import growthcraft.core.shared.Reference; import net.minecraft.core.HolderLookup; import net.minecraft.data.DataGenerator; @@ -35,9 +36,8 @@ public static void gatherData(GatherDataEvent event) { generator.addProvider(event.includeServer(), new GrowthcraftCoreRecipes(packOutput)); generator.addProvider(event.includeServer(), new GrowthcraftCoreLootTableProvider(packOutput)); generator.addProvider(event.includeServer(), new GrowthcraftCoreGlobalLootModifiersProvider(packOutput)); + generator.addProvider(event.includeServer(), new GrowthcraftCoreWorldGenProvider(packOutput, lookupProvider)); // generator.addProvider(event.includeServer(), new LootTableProvider(packOutput, Collections.emptySet(), // List.of(new LootTableProvider.SubProviderEntry(GrowthcraftCoreLootTables::new, LootContextParamSets.BLOCK)))); } - - } diff --git a/src/main/java/growthcraft/core/datagen/providers/GrowthcraftCoreWorldGenProvider.java b/src/main/java/growthcraft/core/datagen/providers/GrowthcraftCoreWorldGenProvider.java new file mode 100644 index 00000000..e2c0bda2 --- /dev/null +++ b/src/main/java/growthcraft/core/datagen/providers/GrowthcraftCoreWorldGenProvider.java @@ -0,0 +1,32 @@ +package growthcraft.core.datagen.providers; + +import java.util.Set; +import java.util.concurrent.CompletableFuture; + +import growthcraft.core.shared.Reference; +import growthcraft.core.world.GrowthcraftBiomeModifiers; +import growthcraft.core.world.GrowthcraftConfiguredFeatures; +import growthcraft.core.world.GrowthcraftPlacedFeatures; +import net.minecraft.core.HolderLookup.Provider; +import net.minecraft.core.RegistrySetBuilder; +import net.minecraft.core.registries.Registries; +import net.minecraft.data.PackOutput; +import net.minecraftforge.common.data.DatapackBuiltinEntriesProvider; +import net.minecraftforge.registries.ForgeRegistries; + +public class GrowthcraftCoreWorldGenProvider extends DatapackBuiltinEntriesProvider{ + public static final RegistrySetBuilder BUILDER = new RegistrySetBuilder() + .add(Registries.CONFIGURED_FEATURE, GrowthcraftConfiguredFeatures::bootstrap) + .add(Registries.PLACED_FEATURE, GrowthcraftPlacedFeatures::bootstrap) + .add(ForgeRegistries.Keys.BIOME_MODIFIERS, GrowthcraftBiomeModifiers::bootstrap); + + public GrowthcraftCoreWorldGenProvider(PackOutput output, CompletableFuture registries) { + super(output, registries, BUILDER, Set.of(Reference.MODID)); + } + + @Override + public String getName() { + return "Growthcraft WorldGen"; + } + +} diff --git a/src/main/java/growthcraft/core/world/GrowthcraftBiomeModifiers.java b/src/main/java/growthcraft/core/world/GrowthcraftBiomeModifiers.java new file mode 100644 index 00000000..bc7c4172 --- /dev/null +++ b/src/main/java/growthcraft/core/world/GrowthcraftBiomeModifiers.java @@ -0,0 +1,50 @@ +package growthcraft.core.world; + +import growthcraft.core.shared.Reference; +import net.minecraft.core.HolderSet; +import net.minecraft.core.registries.Registries; +import net.minecraft.data.worldgen.BootstapContext; +import net.minecraft.resources.ResourceKey; +import net.minecraft.resources.ResourceLocation; +import net.minecraft.tags.BiomeTags; +import net.minecraft.world.level.levelgen.GenerationStep; +import net.minecraftforge.common.world.BiomeModifier; +import net.minecraftforge.common.world.ForgeBiomeModifiers; +import net.minecraftforge.registries.ForgeRegistries; + +public class GrowthcraftBiomeModifiers { + public static final ResourceKey ADD_SALT_ORE = registerKey("add_salt_ore"); + public static final ResourceKey ADD_DEEPSLATE_SALT_ORE = registerKey("add_deepslate_salt_ore"); + public static final ResourceKey ADD_NETHER_SALT_ORE = registerKey("add_nether_salt_ore"); + public static final ResourceKey ADD_END_SALT_ORE = registerKey("add_end_salt_ore"); + + + public static void bootstrap(BootstapContext context) { + var placedFeatures = context.lookup(Registries.PLACED_FEATURE); + var biomes = context.lookup(Registries.BIOME); + + context.register(ADD_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.SALT_ORE_PLACED_KEY)), + GenerationStep.Decoration.UNDERGROUND_ORES)); + + context.register(ADD_DEEPSLATE_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_OVERWORLD), + HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.DEEPSLATE_SALT_ORE_PLACED_KEY)), + GenerationStep.Decoration.UNDERGROUND_ORES)); + + context.register(ADD_NETHER_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_NETHER), + HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.NETHER_SALT_ORE_PLACED_KEY)), + GenerationStep.Decoration.UNDERGROUND_ORES)); + + context.register(ADD_END_SALT_ORE, new ForgeBiomeModifiers.AddFeaturesBiomeModifier( + biomes.getOrThrow(BiomeTags.IS_END), + HolderSet.direct(placedFeatures.getOrThrow(GrowthcraftPlacedFeatures.END_SALT_ORE_PLACED_KEY)), + GenerationStep.Decoration.UNDERGROUND_ORES)); + } + + private static ResourceKey registerKey(String name) { + return ResourceKey.create(ForgeRegistries.Keys.BIOME_MODIFIERS, new ResourceLocation(Reference.MODID, name)); + } +} diff --git a/src/main/java/growthcraft/core/world/GrowthcraftConfiguredFeatures.java b/src/main/java/growthcraft/core/world/GrowthcraftConfiguredFeatures.java index ee1a03a7..50bc2920 100644 --- a/src/main/java/growthcraft/core/world/GrowthcraftConfiguredFeatures.java +++ b/src/main/java/growthcraft/core/world/GrowthcraftConfiguredFeatures.java @@ -19,17 +19,17 @@ import net.minecraft.world.level.levelgen.structure.templatesystem.TagMatchTest; public class GrowthcraftConfiguredFeatures { - public static final ResourceKey> OVERWORLD_SALT_ORE_KEY + public static final ResourceKey> SALT_ORE_KEY = registerKey(Reference.UnlocalizedName.SALT_ORE); public static final ResourceKey> NETHER_SALT_ORE_KEY - = registerKey(Reference.UnlocalizedName.SALT_ORE + "_nether"); + = registerKey("nether_" + Reference.UnlocalizedName.SALT_ORE); public static final ResourceKey> END_SALT_ORE_KEY - = registerKey(Reference.UnlocalizedName.SALT_ORE + "_end"); + = registerKey("end_" + Reference.UnlocalizedName.SALT_ORE); public static final ResourceKey> DEEPSLATE_SALT_ORE_KEY - = registerKey(Reference.UnlocalizedName.SALT_ORE + "_deepslate"); + = registerKey("deepslate_" + Reference.UnlocalizedName.SALT_ORE); private static final int SALT_ORE_GEN_VEIN_SIZE = GrowthcraftConfig.getSaltOreGenVeinSize(); // Iron is 9, Diamond is 0.7 @@ -43,9 +43,9 @@ public static void bootstrap(BootstapContext> context) { RuleTest deepslateReplaceable = new TagMatchTest(BlockTags.DEEPSLATE_ORE_REPLACEABLES); RuleTest netherrackReplaceable = new BlockMatchTest(Blocks.NETHERRACK); RuleTest endstoneReplaceable = new BlockMatchTest(Blocks.END_STONE); - + if(GrowthcraftConfig.isSaltOreGenEnabled()) { - register(context, OVERWORLD_SALT_ORE_KEY, Feature.ORE, new OreConfiguration(stoneReplaceable, + register(context, SALT_ORE_KEY, Feature.ORE, new OreConfiguration(stoneReplaceable, GrowthcraftBlocks.SALT_ORE.get().defaultBlockState(), SALT_ORE_GEN_VEIN_SIZE)); if (GrowthcraftConfig.isSaltOreGenEnabledForDimension("deepslate")) { @@ -55,12 +55,12 @@ public static void bootstrap(BootstapContext> context) { if (GrowthcraftConfig.isSaltOreGenEnabledForDimension("theend")) { register(context, END_SALT_ORE_KEY, Feature.ORE, new OreConfiguration(endstoneReplaceable, - GrowthcraftBlocks.SALT_ORE_END.get().defaultBlockState(), 9)); + GrowthcraftBlocks.SALT_ORE_END.get().defaultBlockState(), SALT_ORE_GEN_VEIN_SIZE)); } if (GrowthcraftConfig.isSaltOreGenEnabledForDimension("nether")) { register(context, NETHER_SALT_ORE_KEY, Feature.ORE, new OreConfiguration(netherrackReplaceable, - GrowthcraftBlocks.SALT_ORE_NETHER.get().defaultBlockState(), 9)); + GrowthcraftBlocks.SALT_ORE_NETHER.get().defaultBlockState(), SALT_ORE_GEN_VEIN_SIZE)); } } else { Growthcraft.LOGGER.info("Growthcraft Core config has salt generation disabled."); diff --git a/src/main/java/growthcraft/core/world/GrowthcraftPlacedFeatures.java b/src/main/java/growthcraft/core/world/GrowthcraftPlacedFeatures.java index 3506d471..813688e7 100644 --- a/src/main/java/growthcraft/core/world/GrowthcraftPlacedFeatures.java +++ b/src/main/java/growthcraft/core/world/GrowthcraftPlacedFeatures.java @@ -19,11 +19,38 @@ public class GrowthcraftPlacedFeatures { public static final ResourceKey SALT_ORE_PLACED_KEY = createKey(Reference.UnlocalizedName.SALT_ORE_PLACED); + public static final ResourceKey DEEPSLATE_SALT_ORE_PLACED_KEY = createKey("deepslate_" + Reference.UnlocalizedName.SALT_ORE_PLACED); + public static final ResourceKey NETHER_SALT_ORE_PLACED_KEY = createKey("nether_" + Reference.UnlocalizedName.SALT_ORE_PLACED); + public static final ResourceKey END_SALT_ORE_PLACED_KEY = createKey("end_" + Reference.UnlocalizedName.SALT_ORE_PLACED); public static void bootstrap(BootstapContext context) { HolderGetter> configuredFeatures = context.lookup(Registries.CONFIGURED_FEATURE); - register(context, SALT_ORE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftConfiguredFeatures.OVERWORLD_SALT_ORE_KEY), + register(context, SALT_ORE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftConfiguredFeatures.SALT_ORE_KEY), + GrowthcraftOrePlacement.commonOrePlacement( + GrowthcraftConfig.getSaltOreGenSpreadAmount(), + HeightRangePlacement.uniform( + VerticalAnchor.absolute(GrowthcraftConfig.getSaltOreGenHeightMin()), + VerticalAnchor.absolute(GrowthcraftConfig.getSaltOreGenHeightMax())) + )); + + register(context, DEEPSLATE_SALT_ORE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftConfiguredFeatures.DEEPSLATE_SALT_ORE_KEY), + GrowthcraftOrePlacement.commonOrePlacement( + GrowthcraftConfig.getSaltOreGenSpreadAmount(), + HeightRangePlacement.uniform( + VerticalAnchor.absolute(GrowthcraftConfig.getSaltOreGenHeightMin()), + VerticalAnchor.absolute(GrowthcraftConfig.getSaltOreGenHeightMax())) + )); + + register(context, NETHER_SALT_ORE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftConfiguredFeatures.NETHER_SALT_ORE_KEY), + GrowthcraftOrePlacement.commonOrePlacement( + GrowthcraftConfig.getSaltOreGenSpreadAmount(), + HeightRangePlacement.uniform( + VerticalAnchor.absolute(GrowthcraftConfig.getSaltOreGenHeightMin()), + VerticalAnchor.absolute(GrowthcraftConfig.getSaltOreGenHeightMax())) + )); + + register(context, END_SALT_ORE_PLACED_KEY, configuredFeatures.getOrThrow(GrowthcraftConfiguredFeatures.END_SALT_ORE_KEY), GrowthcraftOrePlacement.commonOrePlacement( GrowthcraftConfig.getSaltOreGenSpreadAmount(), HeightRangePlacement.uniform( @@ -45,15 +72,6 @@ private static void register( context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); } - private static void register( - BootstapContext context, - ResourceKey key, - Holder> configuration, - PlacementModifier... modifiers - ) { - register(context, key, configuration, List.of(modifiers)); - } - private GrowthcraftPlacedFeatures() { /* Prevent generation of default public constructor. */ } diff --git a/src/main/resources/data/growthcraft/forge/biome_modifier/salt_ore.json b/src/main/resources/data/growthcraft/forge/biome_modifier_old/salt_ore_old.json similarity index 100% rename from src/main/resources/data/growthcraft/forge/biome_modifier/salt_ore.json rename to src/main/resources/data/growthcraft/forge/biome_modifier_old/salt_ore_old.json diff --git a/src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore_end.json b/src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_end_old.json similarity index 86% rename from src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore_end.json rename to src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_end_old.json index 101b659d..64bf8775 100644 --- a/src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore_end.json +++ b/src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_end_old.json @@ -6,7 +6,7 @@ "targets": [ { "state": { - "Name": "growthcraft:salt_ore" + "Name": "growthcraft:salt_ore_end" }, "target": { "block": "minecraft:end_stone", diff --git a/src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore_nether.json b/src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_nether_old.json similarity index 86% rename from src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore_nether.json rename to src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_nether_old.json index fe695b2c..6ba8cd8c 100644 --- a/src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore_nether.json +++ b/src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_nether_old.json @@ -6,7 +6,7 @@ "targets": [ { "state": { - "Name": "growthcraft:salt_ore" + "Name": "growthcraft:salt_ore_nether" }, "target": { "block": "minecraft:netherrack", diff --git a/src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json b/src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_old.json similarity index 91% rename from src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json rename to src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_old.json index f78c78d6..c904c1a1 100644 --- a/src/main/resources/data/growthcraft/worldgen/configured_feature/salt_ore.json +++ b/src/main/resources/data/growthcraft/worldgen_old/configured_feature/salt_ore_old.json @@ -15,7 +15,7 @@ }, { "state": { - "Name": "growthcraft:salt_ore" + "Name": "growthcraft:salt_ore_deepslate" }, "target": { "predicate_type": "minecraft:tag_match", diff --git a/src/main/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.json b/src/main/resources/data/growthcraft/worldgen_old/placed_feature/salt_ore_placed_old.json similarity index 100% rename from src/main/resources/data/growthcraft/worldgen/placed_feature/salt_ore_placed.json rename to src/main/resources/data/growthcraft/worldgen_old/placed_feature/salt_ore_placed_old.json