diff --git a/build.gradle b/build.gradle index b0e65ab..5978c03 100644 --- a/build.gradle +++ b/build.gradle @@ -1,10 +1,11 @@ plugins { + id "com.modrinth.minotaur" version "2.+" id 'maven-publish' alias libs.plugins.quilt.loom } archivesBaseName = project.archives_base_name -version = "${project.version}+${libs.versions.minecraft.get()}" +version = "${project.version}" group = project.maven_group repositories { @@ -70,6 +71,27 @@ jar { } } + +//modrinth +import com.modrinth.minotaur.dependencies.ModDependency + +modrinth { + token = System.getenv("MODRINTH_TOKEN") // Please use an environment variable for this! The default is `$MODRINTH_TOKEN`. + projectId = "roses-mod" // The ID of your Modrinth project. Slugs will not work. + versionNumber = version // The (preferably SemVer) version of the mod. If not specified, it'll use the `version` declaration + versionType = "Release" // This is the default -- can also be `beta` or `alpha` + uploadFile = remapJar // Tells Minotaur to use the remapped jar + gameVersions = ["1.20.1"] // An array of game versions the version supports + loaders = ["quilt"] // Self-explanatory. + dependencies { // A special DSL for creating dependencies + // scope.type + // The scope can be `required`, `optional`, `incompatible`, or `embedded` + // The type can either be `project` or `version` + required.project "qsl" // Creates a new required dependency on Fabric API + optional.project "modmenu"//, "mc1.19.3-0.4.8" // Creates a new optional dependency on this specific version of Sodium + } +} + // Configure the maven publication publishing { publications { diff --git a/gradle.properties b/gradle.properties index cf18ded..d1eca72 100644 --- a/gradle.properties +++ b/gradle.properties @@ -3,8 +3,14 @@ org.gradle.jvmargs = -Xmx1G org.gradle.parallel = true # Mod Properties -version = 2.3.1 +version = 3.0.0 maven_group = xyz.limepot archives_base_name = roses_mod +# Modrinth Metadata +modrinth_slug= roses-mod +modrinth_id= Hxo4BmMk +modrinth_game_versions= 1.20.1 +modrinth_mod_loaders= quilt + # Dependencies are managed at gradle/libs.versions.toml diff --git a/gradle/libs.versions.toml b/gradle/libs.versions.toml index b869cb8..deda86d 100644 --- a/gradle/libs.versions.toml +++ b/gradle/libs.versions.toml @@ -2,7 +2,7 @@ # The latest versions are available at https://lambdaurora.dev/tools/import_quilt.html minecraft = "1.20.1" quilt_mappings = "1.20.1+build.1" -quilt_loader = "0.19.0" +quilt_loader = "0.19.1" quilted_fabric_api = "7.0.2+0.83.0-1.20.1" diff --git a/src/main/java/xyz/limepot/roses_mod/RosesMod.java b/src/main/java/xyz/limepot/roses_mod/RosesMod.java index fa325fb..ec1113d 100644 --- a/src/main/java/xyz/limepot/roses_mod/RosesMod.java +++ b/src/main/java/xyz/limepot/roses_mod/RosesMod.java @@ -13,16 +13,20 @@ import net.minecraft.loot.provider.number.ConstantLootNumberProvider; import net.minecraft.registry.Registries; import net.minecraft.registry.Registry; import net.minecraft.util.Identifier; +import net.minecraft.world.gen.GenerationStep; import org.quiltmc.loader.api.ModContainer; import org.quiltmc.qsl.base.api.entrypoint.ModInitializer; import org.quiltmc.qsl.block.extensions.api.QuiltBlockSettings; import org.quiltmc.qsl.item.setting.api.QuiltItemSettings; +import org.quiltmc.qsl.worldgen.biome.api.BiomeModifications; +import org.quiltmc.qsl.worldgen.biome.api.BiomeSelectors; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import xyz.limepot.roses_mod.world.gen.ModWorldGen; +import xyz.limepot.roses_mod.world.gen.ModFlowerGeneration; import java.util.Random; -//import xyz.limepot.roses_mod.world.feature.ModConfiguredFeatures; + +import static xyz.limepot.roses_mod.world.gen.ModFlowerGeneration.*; public class RosesMod implements ModInitializer { public static final String MOD_ID = "roses_mod"; @@ -41,7 +45,12 @@ public class RosesMod implements ModInitializer { @Override public void onInitialize(ModContainer mod) { //REGISTER WORLDGEN - ModWorldGen.generateWorldGen(); + ModFlowerGeneration.generateFlowers(); + + //BIOME MOD + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.VEGETAL_DECORATION, ROSE_FLOWER_PLACED_KEY); + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.VEGETAL_DECORATION, CYAN_ROSE_FLOWER_PLACED_KEY); + BiomeModifications.addFeature(BiomeSelectors.foundInOverworld(), GenerationStep.Feature.VEGETAL_DECORATION, CYAN_ROSE_BUSH_PLACED_KEY); //REGISTER BLOCKS AND BLOCK ITEMS diff --git a/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java b/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java index 64b95c2..01628ef 100644 --- a/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java +++ b/src/main/java/xyz/limepot/roses_mod/world/gen/ModFlowerGeneration.java @@ -1,38 +1,22 @@ package xyz.limepot.roses_mod.world.gen; + import net.minecraft.registry.RegistryKey; import net.minecraft.registry.RegistryKeys; import net.minecraft.util.Identifier; -import net.minecraft.world.biome.Biomes; -import net.minecraft.world.gen.GenerationStep; -import net.minecraft.world.gen.feature.ConfiguredFeature; import net.minecraft.world.gen.feature.PlacedFeature; -import org.quiltmc.qsl.worldgen.biome.api.BiomeModifications; -import org.quiltmc.qsl.worldgen.biome.api.BiomeSelectors; +import xyz.limepot.roses_mod.RosesMod; import static xyz.limepot.roses_mod.RosesMod.MOD_ID; public class ModFlowerGeneration { - /* + public static final RegistryKey ROSE_FLOWER_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier("roses_mod","rose_flower")); + public static final RegistryKey CYAN_ROSE_FLOWER_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier("roses_mod","cyan_rose_flower")); + public static final RegistryKey CYAN_ROSE_BUSH_PLACED_KEY = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier("roses_mod","cyan_rose_bush")); + public static void generateFlowers() { - //ROSE FLOWER - RegistryKey roseFlowerTag = RegistryKey.of(RegistryKeys.TAGS, new Identifier(MOD_ID, "rose_flowers")); - BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, roseFlowerTag); - //CYAN ROSE - RegistryKey cyanRoseTag = RegistryKey.of(RegistryKeys.TAGS, new Identifier(MOD_ID, "cyan_roses")); - BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, cyanRoseTag); - //CYAN ROSE BUSH - RegistryKey cyanRoseBushT ag = RegistryKey.of(RegistryKeys.TAGS, new Identifier(MOD_ID, "cyan_rose_bushes")); - BiomeModifications.addFeature(BiomeSelectors.includeByKey(BiomeKeys.PLAINS), GenerationStep.Feature.VEGETAL_DECORATION, cyanRoseBushTag); - } - */ - public static void generateFlowers() {/* - RegistryKey> cyanRoseBushTag = RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bush")); - RegistryKey cyanRoseBushTagKey = RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bushes")); - BiomeModifications.addFeature(BiomeSelectors.includeByKey(Biomes.FOREST), - GenerationStep.Feature.VEGETAL_DECORATION, - RegistryKey.of(RegistryKeys.PLACED_FEATURE, new Identifier(MOD_ID, "cyan_rose_bush")));*/ + RosesMod.LOGGER.debug("Registering Features..."); } } diff --git a/src/main/java/xyz/limepot/roses_mod/world/gen/ModWorldGen.java b/src/main/java/xyz/limepot/roses_mod/world/gen/ModWorldGen.java deleted file mode 100644 index 868274f..0000000 --- a/src/main/java/xyz/limepot/roses_mod/world/gen/ModWorldGen.java +++ /dev/null @@ -1,7 +0,0 @@ -package xyz.limepot.roses_mod.world.gen; - -public class ModWorldGen { - public static void generateWorldGen() { - ModFlowerGeneration.generateFlowers(); - } -} diff --git a/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json b/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json new file mode 100644 index 0000000..7404bb2 --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:flower", + "config": { + "tries": 64, + "xz_spread": 7, + "y_spread": 3, + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "weight": 5, + "data": { + "Name": "roses_mod:cyan_rose_bush" + } + } + ] + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + } + } +} diff --git a/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_flower.json b/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_flower.json new file mode 100644 index 0000000..4f25449 --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/configured_feature/cyan_rose_flower.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:flower", + "config": { + "tries": 64, + "xz_spread": 7, + "y_spread": 3, + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "weight": 5, + "data": { + "Name": "roses_mod:cyan_rose_flower" + } + } + ] + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + } + } +} diff --git a/src/main/resources/data/roses_mod/worldgen/configured_feature/rose_flower.json b/src/main/resources/data/roses_mod/worldgen/configured_feature/rose_flower.json new file mode 100644 index 0000000..f8f0c21 --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/configured_feature/rose_flower.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:flower", + "config": { + "tries": 64, + "xz_spread": 7, + "y_spread": 3, + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "weight": 5, + "data": { + "Name": "roses_mod:rose_flower" + } + } + ] + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + } + } +} diff --git a/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_bush.json b/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_bush.json new file mode 100644 index 0000000..4ebc3cd --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_bush.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:cyan_rose_bush", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 5 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_flower.json b/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_flower.json new file mode 100644 index 0000000..f37c4a2 --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/placed_feature/cyan_rose_flower.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:cyan_rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 16 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/resources/data/roses_mod/worldgen/placed_feature/rose_flower.json b/src/main/resources/data/roses_mod/worldgen/placed_feature/rose_flower.json new file mode 100644 index 0000000..9fafabc --- /dev/null +++ b/src/main/resources/data/roses_mod/worldgen/placed_feature/rose_flower.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 32 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} diff --git a/src/main/resources/quilt.mod.json b/src/main/resources/quilt.mod.json index 4fbc482..dd4a42b 100644 --- a/src/main/resources/quilt.mod.json +++ b/src/main/resources/quilt.mod.json @@ -26,11 +26,11 @@ "depends": [ { "id": "quilt_loader", - "versions": ">=0.19.0" + "versions": ">=0.19.1" }, { "id": "quilted_fabric_api", - "versions": ">=7.0.2+0.83.0-1.20.1" + "versions": ">=7.0.2" }, { "id": "minecraft",