From cc520e232a41f6dda6e501088d7d4cdb9ecd46dd Mon Sep 17 00:00:00 2001 From: Octal Date: Wed, 12 Jul 2023 22:23:29 -0500 Subject: [PATCH] Make ore generate and fix recipes and lang --- data/lang/en_us.fennec | 5 +++ data/recipes/sculk_resonator.fennec | 2 +- data/world/biome/forgotten_fields.fennec | 2 ++ .../configured_feature/ore/rose_quartz.fennec | 22 +++++++++++++ .../placed_feature/ore/rose_quartz.fennec | 18 +++++++++++ .../ore/rose_quartz_biome.fennec | 18 +++++++++++ gradle.properties | 2 +- .../sweetberry/wwizardry/WanderingMod.java | 2 ++ .../wwizardry/world/WanderingBiomes.java | 23 ------------- .../wwizardry/world/WanderingWorldgen.java | 32 +++++++++++++++++++ .../world/region/OverworldRegion.java | 9 ++---- .../worldgen/biome/forgotten_fields.json | 2 +- .../configured_feature/ore/rose_quartz.json | 1 + .../placed_feature/ore/rose_quartz.json | 1 + .../placed_feature/ore/rose_quartz_biome.json | 1 + 15 files changed, 108 insertions(+), 32 deletions(-) create mode 100644 data/world/configured_feature/ore/rose_quartz.fennec create mode 100644 data/world/placed_feature/ore/rose_quartz.fennec create mode 100644 data/world/placed_feature/ore/rose_quartz_biome.fennec delete mode 100644 src/main/java/dev/sweetberry/wwizardry/world/WanderingBiomes.java create mode 100644 src/main/java/dev/sweetberry/wwizardry/world/WanderingWorldgen.java create mode 100644 src/main/resources/data/wwizardry/worldgen/configured_feature/ore/rose_quartz.json create mode 100644 src/main/resources/data/wwizardry/worldgen/placed_feature/ore/rose_quartz.json create mode 100644 src/main/resources/data/wwizardry/worldgen/placed_feature/ore/rose_quartz_biome.json diff --git a/data/lang/en_us.fennec b/data/lang/en_us.fennec index 2190c837..235be4df 100644 --- a/data/lang/en_us.fennec +++ b/data/lang/en_us.fennec @@ -9,6 +9,7 @@ crystalline_sculk_block = "Crystalline Sculk Block" reinforced_glass = "Reinforced Glass" reinforced_glass_pane = "Reinforced Glass Pane" + sculk_resonator = "Resonating Sculk Shrieker" # Tech camera = "Camera" @@ -20,6 +21,7 @@ # Natural sculkflower = "Sculkflower" indigo_caeruleum = "Indigo Caeruleum" + mycelial_sand = "Mycelial Sand" # Altar altar_pedestal = "Altar Pedestal" @@ -87,6 +89,9 @@ "item.wwizardry" { crystalline_sculk = "Crystalline Sculk" rose_quartz = "Rose Quartz" + + denia_boat = "Denia Boat" + denia_chest_boat = "Denia Boat with Chest" } # Compat diff --git a/data/recipes/sculk_resonator.fennec b/data/recipes/sculk_resonator.fennec index 1e3563b5..f3ad1d98 100644 --- a/data/recipes/sculk_resonator.fennec +++ b/data/recipes/sculk_resonator.fennec @@ -6,7 +6,7 @@ bloom = 10 inputs [ { item = "amethyst_shard" } { item = "amethyst_shard" } - { item = "redstone_dust" } + { item = "redstone" } { item = "wwizardry:crystalline_sculk" } ] diff --git a/data/world/biome/forgotten_fields.fennec b/data/world/biome/forgotten_fields.fennec index af16de4e..c170d5e9 100644 --- a/data/world/biome/forgotten_fields.fennec +++ b/data/world/biome/forgotten_fields.fennec @@ -67,6 +67,8 @@ features [ "disk_sand" "disk_clay" "disk_gravel" + + "wwizardry:ore/rose_quartz_biome" ] [ "sculk_vein" diff --git a/data/world/configured_feature/ore/rose_quartz.fennec b/data/world/configured_feature/ore/rose_quartz.fennec new file mode 100644 index 00000000..900ace37 --- /dev/null +++ b/data/world/configured_feature/ore/rose_quartz.fennec @@ -0,0 +1,22 @@ +type = "ore" + +config { + discard_chance_on_air_exposure = 0 + size = 6 + targets [ + { + state { Name = "wwizardry:rose_quartz_ore" } + target { + predicate_type = "tag_match" + tag = "stone_ore_replaceables" + } + } + { + state { Name = "wwizardry:deepslate_rose_quartz_ore" } + target { + predicate_type = "tag_match" + tag = "deepslate_ore_replaceables" + } + } + ] +} diff --git a/data/world/placed_feature/ore/rose_quartz.fennec b/data/world/placed_feature/ore/rose_quartz.fennec new file mode 100644 index 00000000..04b91fed --- /dev/null +++ b/data/world/placed_feature/ore/rose_quartz.fennec @@ -0,0 +1,18 @@ +feature = "wwizardry:ore/rose_quartz" + +placement [ + { + type = "count" + count = 13 + } + { type = "in_square" } + { + type = "height_range" + height { + type = "trapezoid" + max_inclusive { above_bottom = 96 } + min_inclusive { above_bottom = -16 } + } + } + { type = "biome" } +] diff --git a/data/world/placed_feature/ore/rose_quartz_biome.fennec b/data/world/placed_feature/ore/rose_quartz_biome.fennec new file mode 100644 index 00000000..47eb675f --- /dev/null +++ b/data/world/placed_feature/ore/rose_quartz_biome.fennec @@ -0,0 +1,18 @@ +feature = "wwizardry:ore/rose_quartz" + +placement [ + { + type = "count" + count = 6 + } + { type = "in_square" } + { + type = "height_range" + height { + type = "trapezoid" + max_inclusive { above_bottom = 128 } + min_inclusive { above_bottom = 0 } + } + } + { type = "biome" } +] diff --git a/gradle.properties b/gradle.properties index 8050a3b4..7d4f3026 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,7 +3,7 @@ org.gradle.jvmargs = -Xmx1G org.gradle.parallel = true # Mod Properties -version = 0.1.0-blanketcon +version = 0.1.1-blanketcon maven_group = dev.sweetberry archives_base_name = wwizardry diff --git a/src/main/java/dev/sweetberry/wwizardry/WanderingMod.java b/src/main/java/dev/sweetberry/wwizardry/WanderingMod.java index d18f281b..e417a4b8 100644 --- a/src/main/java/dev/sweetberry/wwizardry/WanderingMod.java +++ b/src/main/java/dev/sweetberry/wwizardry/WanderingMod.java @@ -6,6 +6,7 @@ import dev.sweetberry.wwizardry.datagen.WanderingDatagen; import dev.sweetberry.wwizardry.item.WanderingItems; import dev.sweetberry.wwizardry.recipe.WanderingRecipes; +import dev.sweetberry.wwizardry.world.WanderingWorldgen; import net.fabricmc.fabric.api.event.player.UseBlockCallback; import net.minecraft.advancement.criterion.Criteria; import net.minecraft.block.*; @@ -45,6 +46,7 @@ public void onInitialize(ModContainer mod) { WanderingItems.init(); WanderingRecipes.init(); WanderingDatagen.init(); + WanderingWorldgen.init(); UseBlockCallback.EVENT.register(WanderingMod::onBlockUse); RegistryMonitor.create(Registries.BLOCK).forAll((ctx) -> onBlockAdded(ctx.value(), ctx.id())); } diff --git a/src/main/java/dev/sweetberry/wwizardry/world/WanderingBiomes.java b/src/main/java/dev/sweetberry/wwizardry/world/WanderingBiomes.java deleted file mode 100644 index 9456d7e7..00000000 --- a/src/main/java/dev/sweetberry/wwizardry/world/WanderingBiomes.java +++ /dev/null @@ -1,23 +0,0 @@ -package dev.sweetberry.wwizardry.world; - -import dev.sweetberry.wwizardry.WanderingMod; -import net.minecraft.registry.RegistryKey; -import net.minecraft.registry.RegistryKeys; -import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.Biomes; -import net.minecraft.world.biome.source.util.MultiNoiseUtil; -import terrablender.api.ModifiedVanillaOverworldBuilder; -import terrablender.api.ParameterUtils; - -public class WanderingBiomes { - private static final MultiNoiseUtil.ParameterRange FULL_RANGE = MultiNoiseUtil.ParameterRange.of(-1.0f, 1.0f); - public static final RegistryKey FORGOTTEN_FIELDS = key("forgotten_fields"); - - public static RegistryKey key(String path) { - return RegistryKey.of(RegistryKeys.BIOME, WanderingMod.id(path)); - } - - public static void overworld(ModifiedVanillaOverworldBuilder map) { - map.replaceBiome(Biomes.MEADOW, FORGOTTEN_FIELDS); - } -} diff --git a/src/main/java/dev/sweetberry/wwizardry/world/WanderingWorldgen.java b/src/main/java/dev/sweetberry/wwizardry/world/WanderingWorldgen.java new file mode 100644 index 00000000..6df84e8a --- /dev/null +++ b/src/main/java/dev/sweetberry/wwizardry/world/WanderingWorldgen.java @@ -0,0 +1,32 @@ +package dev.sweetberry.wwizardry.world; + +import dev.sweetberry.wwizardry.WanderingMod; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.world.biome.Biome; +import net.minecraft.world.biome.Biomes; +import net.minecraft.world.biome.source.util.MultiNoiseUtil; +import net.minecraft.world.gen.GenerationStep; +import net.minecraft.world.gen.feature.PlacedFeature; +import org.quiltmc.qsl.worldgen.biome.api.BiomeModifications; +import org.quiltmc.qsl.worldgen.biome.api.BiomeSelectors; +import org.quiltmc.qsl.worldgen.biome.api.ModificationPhase; +import terrablender.api.ModifiedVanillaOverworldBuilder; + +public class WanderingWorldgen { + private static final MultiNoiseUtil.ParameterRange FULL_RANGE = MultiNoiseUtil.ParameterRange.of(-1.0f, 1.0f); + public static final RegistryKey FORGOTTEN_FIELDS = key("forgotten_fields"); + public static final RegistryKey ROSE_QUARTZ = RegistryKey.of(RegistryKeys.PLACED_FEATURE, WanderingMod.id("ore/rose_quartz")); + + public static RegistryKey key(String path) { + return RegistryKey.of(RegistryKeys.BIOME, WanderingMod.id(path)); + } + + public static void init() { + var modification = BiomeModifications.create(WanderingMod.id("modifications")); + + modification.add(ModificationPhase.ADDITIONS, BiomeSelectors.foundInOverworld(), (ctx, modifications) -> { + modifications.getGenerationSettings().addFeature(GenerationStep.Feature.UNDERGROUND_ORES, ROSE_QUARTZ); + }); + } +} diff --git a/src/main/java/dev/sweetberry/wwizardry/world/region/OverworldRegion.java b/src/main/java/dev/sweetberry/wwizardry/world/region/OverworldRegion.java index e5381819..d05fd717 100644 --- a/src/main/java/dev/sweetberry/wwizardry/world/region/OverworldRegion.java +++ b/src/main/java/dev/sweetberry/wwizardry/world/region/OverworldRegion.java @@ -2,14 +2,11 @@ import com.mojang.datafixers.util.Pair; import dev.sweetberry.wwizardry.WanderingMod; -import dev.sweetberry.wwizardry.world.WanderingBiomes; +import dev.sweetberry.wwizardry.world.WanderingWorldgen; import net.minecraft.registry.Registry; import net.minecraft.registry.RegistryKey; import net.minecraft.world.biome.Biome; -import net.minecraft.world.biome.Biomes; -import net.minecraft.world.biome.OverworldBiomeCreator; import net.minecraft.world.biome.source.util.MultiNoiseUtil; -import net.minecraft.world.biome.source.util.OverworldBiomeParameters; import terrablender.api.Region; import terrablender.api.RegionType; @@ -29,13 +26,13 @@ public void addBiomes(Registry registry, Consumer