diff --git a/MC19.3-19.4/build.gradle.kts b/MC19.3-19.4/build.gradle.kts new file mode 100644 index 0000000..b7408fa --- /dev/null +++ b/MC19.3-19.4/build.gradle.kts @@ -0,0 +1,98 @@ +import org.jetbrains.kotlin.gradle.dsl.JvmTarget +import org.jetbrains.kotlin.gradle.tasks.KotlinCompile + +plugins { + java + id("org.jetbrains.kotlin.jvm") version "2.1.0" + id("fabric-loom") version "1.9-SNAPSHOT" + id("com.modrinth.minotaur") version "2.+" + id("maven-publish") +} + +version = project.property("mod_version") as String +group = project.property("maven_group") as String +base { + archivesName.set(project.property("archives_base_name") as String) +} + +val targetJavaVersion = 17 +java { + toolchain.languageVersion = JavaLanguageVersion.of(targetJavaVersion) + // Loom will automatically attach sourcesJar to a RemapSourcesJar task and to the "build" task + // if it is present. + // If you remove this line, sources will not be generated. + withSourcesJar() +} + +repositories { + // Add repositories to retrieve artifacts from in here. + // You should only use this when depending on other mods because + // Loom adds the essential maven repositories to download Minecraft and libraries from automatically. + // See https://docs.gradle.org/current/userguide/declaring_repositories.html + // for more information about repositories. +} + +dependencies { + // To change the versions see the gradle.properties file + minecraft("com.mojang:minecraft:${project.property("minecraft_version")}") + mappings("net.fabricmc:yarn:${project.property("yarn_mappings")}:v2") + modImplementation("net.fabricmc:fabric-loader:${project.property("loader_version")}") + modImplementation("net.fabricmc:fabric-language-kotlin:${project.property("kotlin_loader_version")}") + modImplementation("net.fabricmc.fabric-api:fabric-api:${project.property("fabric_version")}") +} + +modrinth { + token.set(System.getenv("MODRINTH_TOKEN")) + projectId.set("Hxo4BmMk") + versionNumber.set(project.property("mod_version").toString()) + versionType.set("release") + uploadFile.set(tasks.remapJar) + gameVersions.addAll("1.20", "1.20.1", "1.20.2", "1.20.3", "1.20.4") + loaders.addAll("fabric", "quilt") + dependencies { + // The scope can be `required`, `optional`, `incompatible`, or `embedded` + // The type can either be `project` or `version` + required.project("fabric-api") + required.project("fabric-language-kotlin") + } + syncBodyFrom = rootProject.file("README.md").readText() +} + +tasks.processResources { + inputs.property("version", project.property("mod_version")) + inputs.property("minecraft_version", project.property("minecraft_version")) + inputs.property("loader_version", project.property("loader_version")) + filteringCharset = "UTF-8" + + filesMatching("fabric.mod.json") { + expand( + "version" to project.property("mod_version"), + "minecraft_version" to project.property("minecraft_version"), + "loader_version" to project.property("loader_version"), + "kotlin_loader_version" to project.property("kotlin_loader_version"), + ) + } +} + +tasks.withType().configureEach { + // ensure that the encoding is set to UTF-8, no matter what the system default is + // this fixes some edge cases with special characters not displaying correctly + // see http://yodaconditions.net/blog/fix-for-java-file-encoding-problems-with-gradle.html + // If Javadoc is generated, this must be specified in that task too. + options.encoding = "UTF-8" + options.release.set(targetJavaVersion) +} + +tasks.withType().configureEach { + compilerOptions.jvmTarget.set(JvmTarget.fromTarget(targetJavaVersion.toString())) +} + +tasks.jar { + from("LICENSE") { + rename { "${it}_${project.base.archivesName}" } + } +} + +fabricApi { + configureDataGeneration() +} diff --git a/MC19.3-19.4/gradle.properties b/MC19.3-19.4/gradle.properties new file mode 100644 index 0000000..dd3af2c --- /dev/null +++ b/MC19.3-19.4/gradle.properties @@ -0,0 +1,18 @@ +# Done to increase the memory available to gradle. +org.gradle.jvmargs=-Xmx1G + +# Fabric Properties + # check these on https://modmuss50.me/fabric.html + minecraft_version=1.19.4 + yarn_mappings=1.19.4+build.2 + loader_version=0.16.9 + kotlin_loader_version=1.13.0+kotlin.2.1.0 + +# Mod Properties + mod_version = 2.0+1.19.3-1.19.4 + maven_group = observer.nelle + archives_base_name = roses_mod + +# Dependencies + # check this on https://modmuss50.me/fabric.html + fabric_version=0.87.2+1.19.4 diff --git a/MC19.3-19.4/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json b/MC19.3-19.4/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json new file mode 100644 index 0000000..c837ffe --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json @@ -0,0 +1,53 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + } + ], + "name": "minecraft:rose_bush" + }, + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 5.0, + "min": 2.0 + }, + "function": "minecraft:set_count" + }, + { + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops", + "function": "minecraft:apply_bonus" + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "roses_mod:rose_flower" + } + ] + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/flower_pots.json b/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/flower_pots.json new file mode 100644 index 0000000..befe072 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/flower_pots.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "roses_mod:potted_rose", + "roses_mod:potted_cyan" + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/small_flowers.json b/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/small_flowers.json new file mode 100644 index 0000000..a803576 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/small_flowers.json @@ -0,0 +1,7 @@ +{ + "replace": false, + "values": [ + "roses_mod:rose_flower", + "roses_mod:cyan_rose" + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json b/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json new file mode 100644 index 0000000..427b648 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "values": [ + "roses_mod:cyan_rose_bush" + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json new file mode 100644 index 0000000..f9bd3d6 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_cyan_rose": { + "conditions": { + "items": [ + { + "items": [ + "roses_mod:cyan_rose" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "roses_mod:cyan_rose_bush" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_cyan_rose", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "roses_mod:cyan_rose_bush" + ] + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json new file mode 100644 index 0000000..49ee023 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_rose_flower": { + "conditions": { + "items": [ + { + "items": [ + "roses_mod:rose_flower" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:rose_bush" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_rose_flower", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "minecraft:rose_bush" + ] + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json new file mode 100644 index 0000000..0962907 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_cyan_rose": { + "conditions": { + "items": [ + { + "items": [ + "roses_mod:cyan_rose" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:cyan_dye_from_cyan_rose" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_cyan_rose", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "minecraft:cyan_dye_from_cyan_rose" + ] + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json new file mode 100644 index 0000000..d2f9a38 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json @@ -0,0 +1,34 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_rose_flower": { + "conditions": { + "items": [ + { + "items": [ + "roses_mod:rose_flower" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "minecraft:red_dye_from_rose_flower" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_rose_flower", + "has_the_recipe" + ] + ], + "rewards": { + "recipes": [ + "minecraft:red_dye_from_rose_flower" + ] + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose.json b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose.json new file mode 100644 index 0000000..58b664f --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "roses_mod:cyan_rose" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json new file mode 100644 index 0000000..f8a3d1d --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json @@ -0,0 +1,53 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "entries": [ + { + "type": "minecraft:alternatives", + "children": [ + { + "type": "minecraft:item", + "conditions": [ + { + "condition": "minecraft:match_tool", + "predicate": { + "items": [ + "minecraft:shears" + ] + } + } + ], + "name": "roses_mod:cyan_rose_bush" + }, + { + "type": "minecraft:item", + "functions": [ + { + "add": false, + "count": { + "type": "minecraft:uniform", + "max": 5.0, + "min": 2.0 + }, + "function": "minecraft:set_count" + }, + { + "enchantment": "minecraft:fortune", + "formula": "minecraft:ore_drops", + "function": "minecraft:apply_bonus" + }, + { + "function": "minecraft:explosion_decay" + } + ], + "name": "roses_mod:cyan_rose" + } + ] + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/potted_cyan.json b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/potted_cyan.json new file mode 100644 index 0000000..c55ac8a --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/potted_cyan.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "roses_mod:cyan_rose" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/potted_rose.json b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/potted_rose.json new file mode 100644 index 0000000..c13492f --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/potted_rose.json @@ -0,0 +1,35 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "minecraft:flower_pot" + } + ], + "rolls": 1.0 + }, + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "roses_mod:rose_flower" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/rose_flower.json b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/rose_flower.json new file mode 100644 index 0000000..6a1d883 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/loot_tables/blocks/rose_flower.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "bonus_rolls": 0.0, + "conditions": [ + { + "condition": "minecraft:survives_explosion" + } + ], + "entries": [ + { + "type": "minecraft:item", + "name": "roses_mod:rose_flower" + } + ], + "rolls": 1.0 + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/cyan_dye_from_cyan_rose.json b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/cyan_dye_from_cyan_rose.json new file mode 100644 index 0000000..67dd26f --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/cyan_dye_from_cyan_rose.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "group": "dye", + "ingredients": [ + { + "item": "roses_mod:cyan_rose" + } + ], + "result": { + "count": 2, + "item": "minecraft:cyan_dye" + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/cyan_rose_bush.json b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/cyan_rose_bush.json new file mode 100644 index 0000000..60d152b --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/cyan_rose_bush.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "roses_mod:cyan_rose" + } + }, + "pattern": [ + "##", + "##" + ], + "result": { + "item": "roses_mod:cyan_rose_bush" + }, + "show_notification": true +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/red_dye_from_rose_flower.json b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/red_dye_from_rose_flower.json new file mode 100644 index 0000000..bda1145 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/red_dye_from_rose_flower.json @@ -0,0 +1,14 @@ +{ + "type": "minecraft:crafting_shapeless", + "category": "misc", + "group": "dye", + "ingredients": [ + { + "item": "roses_mod:rose_flower" + } + ], + "result": { + "count": 2, + "item": "minecraft:red_dye" + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/rose_bush.json b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/rose_bush.json new file mode 100644 index 0000000..e9bf47d --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/recipes/rose_bush.json @@ -0,0 +1,17 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "roses_mod:rose_flower" + } + }, + "pattern": [ + "##", + "##" + ], + "result": { + "item": "minecraft:rose_bush" + }, + "show_notification": true +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json new file mode 100644 index 0000000..8e7a1fb --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/cyan_rose_bush.json @@ -0,0 +1,33 @@ +{ + "type": "minecraft:random_patch", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:simple_state_provider", + "state": { + "Name": "roses_mod:cyan_rose_bush", + "Properties": { + "half": "lower" + } + } + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 96, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/cyan_rose_flower.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/cyan_rose_flower.json new file mode 100644 index 0000000..651f024 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/cyan_rose_flower.json @@ -0,0 +1,41 @@ +{ + "type": "minecraft:flower", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "roses_mod:cyan_rose" + }, + "weight": 2 + }, + { + "data": { + "Name": "roses_mod:cyan_rose" + }, + "weight": 1 + } + ] + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 64, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/rose_flower.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/rose_flower.json new file mode 100644 index 0000000..1ae6fb1 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/configured_feature/rose_flower.json @@ -0,0 +1,41 @@ +{ + "type": "minecraft:flower", + "config": { + "feature": { + "feature": { + "type": "minecraft:simple_block", + "config": { + "to_place": { + "type": "minecraft:weighted_state_provider", + "entries": [ + { + "data": { + "Name": "roses_mod:rose_flower" + }, + "weight": 2 + }, + { + "data": { + "Name": "roses_mod:rose_flower" + }, + "weight": 1 + } + ] + } + } + }, + "placement": [ + { + "type": "minecraft:block_predicate_filter", + "predicate": { + "type": "minecraft:matching_blocks", + "blocks": "minecraft:air" + } + } + ] + }, + "tries": 64, + "xz_spread": 7, + "y_spread": 3 + } +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_bush_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_bush_placed.json new file mode 100644 index 0000000..a65448e --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_bush_placed.json @@ -0,0 +1,36 @@ +{ + "feature": "roses_mod:cyan_rose_bush", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 85 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:count", + "count": { + "type": "minecraft:clamped", + "value": { + "max_inclusive": 3, + "min_inclusive": 0, + "source": { + "type": "minecraft:uniform", + "value": { + "max_inclusive": 3, + "min_inclusive": -1 + } + } + } + } + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_common_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_common_placed.json new file mode 100644 index 0000000..bd9cc93 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_common_placed.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:cyan_rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 45 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_placed.json new file mode 100644 index 0000000..c66607b --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_placed.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:cyan_rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 70 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_rare_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_rare_placed.json new file mode 100644 index 0000000..0c919f2 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/cyan_rose_rare_placed.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:cyan_rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 90 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_common_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_common_placed.json new file mode 100644 index 0000000..95d3106 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_common_placed.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 4 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_placed.json new file mode 100644 index 0000000..1b71a0f --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_placed.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" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_rare_placed.json b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_rare_placed.json new file mode 100644 index 0000000..79fbde8 --- /dev/null +++ b/MC19.3-19.4/src/main/generated/data/roses_mod/worldgen/placed_feature/rose_rare_placed.json @@ -0,0 +1,19 @@ +{ + "feature": "roses_mod:rose_flower", + "placement": [ + { + "type": "minecraft:rarity_filter", + "chance": 80 + }, + { + "type": "minecraft:in_square" + }, + { + "type": "minecraft:heightmap", + "heightmap": "MOTION_BLOCKING" + }, + { + "type": "minecraft:biome" + } + ] +} \ No newline at end of file diff --git a/MC19.3-19.4/src/main/java/observer/nelle/roses/RosesDataGenerator.java b/MC19.3-19.4/src/main/java/observer/nelle/roses/RosesDataGenerator.java new file mode 100644 index 0000000..80aad78 --- /dev/null +++ b/MC19.3-19.4/src/main/java/observer/nelle/roses/RosesDataGenerator.java @@ -0,0 +1,33 @@ +package observer.nelle.roses; + +import net.fabricmc.fabric.api.datagen.v1.DataGeneratorEntrypoint; +import net.fabricmc.fabric.api.datagen.v1.FabricDataGenerator; +import net.minecraft.registry.RegistryBuilder; +import net.minecraft.registry.RegistryKeys; +import observer.nelle.roses.datagen.RosesBlockTagProvider; +import observer.nelle.roses.datagen.RosesLootTableProvider; +import observer.nelle.roses.datagen.RosesRecipeProvider; +import observer.nelle.roses.datagen.RosesRegistryGenerator; +import observer.nelle.roses.world.RosesConfiguredFeatures; +import observer.nelle.roses.world.RosesPlacedFeatures; + +public class RosesDataGenerator implements DataGeneratorEntrypoint { + + @Override + public void onInitializeDataGenerator(FabricDataGenerator generator) { + FabricDataGenerator.Pack pack = generator.createPack(); + + // Adding a provider example: + // + pack.addProvider(RosesRecipeProvider::new); + pack.addProvider(RosesBlockTagProvider::new); + pack.addProvider(RosesLootTableProvider::new); + pack.addProvider(RosesRegistryGenerator::new); + } + + @Override + public void buildRegistry(RegistryBuilder registryBuilder) { + registryBuilder.addRegistry(RegistryKeys.CONFIGURED_FEATURE, RosesConfiguredFeatures::bootstrap); + registryBuilder.addRegistry(RegistryKeys.PLACED_FEATURE, RosesPlacedFeatures::bootstrap); + } +} diff --git a/MC19.3-19.4/src/main/java/observer/nelle/roses/world/RosesConfiguredFeatures.java b/MC19.3-19.4/src/main/java/observer/nelle/roses/world/RosesConfiguredFeatures.java new file mode 100644 index 0000000..e944fa2 --- /dev/null +++ b/MC19.3-19.4/src/main/java/observer/nelle/roses/world/RosesConfiguredFeatures.java @@ -0,0 +1,57 @@ +package observer.nelle.roses.world; + +// Configured Feature (flowers, how does this look like) -> Placed Feature (How is this feature placed) -> WorldGen/BiomeMod (Where is our feature placed) + +import net.minecraft.block.BlockState; +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.util.Identifier; +import net.minecraft.util.collection.DataPool; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.stateprovider.BlockStateProvider; +import net.minecraft.world.gen.stateprovider.WeightedBlockStateProvider; +import observer.nelle.roses.RosesBlocks; +import observer.nelle.roses.RosesModKt; + +import java.util.Objects; + +public class RosesConfiguredFeatures { + public static final RegistryKey> cyanRoseBushKey = registerKey("cyan_rose_bush"); + public static final RegistryKey> cyanRoseKey = registerKey("cyan_rose_flower"); + public static final RegistryKey> roseKey = registerKey("rose_flower"); + + public static void bootstrap(Registerable> context) { + // pretty much exactly as FOREST_FLOWERS + register(context, cyanRoseBushKey, Feature.RANDOM_PATCH, + ConfiguredFeatures.createRandomPatchFeatureConfig(Feature.SIMPLE_BLOCK, + new SimpleBlockFeatureConfig(BlockStateProvider.of(Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseBush()))))); + + register(context, cyanRoseKey, Feature.FLOWER, + createRandomFlowerPatchFeatureConfig( + new WeightedBlockStateProvider(DataPool.builder() + .add(Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).getDefaultState(), 2) + .add(Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).getDefaultState(), 1)), 64 + )); + + register(context, roseKey, Feature.FLOWER, + createRandomFlowerPatchFeatureConfig( + new WeightedBlockStateProvider(DataPool.builder() + .add(Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).getDefaultState(), 2) + .add(Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).getDefaultState(), 1)), 64 + )); + } + + public static RegistryKey> registerKey(String name) { + return RegistryKey.of(RegistryKeys.CONFIGURED_FEATURE, Identifier.of(RosesModKt.MOD_ID, name)); + } + + private static > void register(Registerable> context, + RegistryKey> key, F feature, FC configuration) { + context.register(key, new ConfiguredFeature<>(feature, configuration)); + } + + private static RandomPatchFeatureConfig createRandomFlowerPatchFeatureConfig(BlockStateProvider block, int tries) { + return ConfiguredFeatures.createRandomPatchFeatureConfig(tries, PlacedFeatures.createEntry(Feature.SIMPLE_BLOCK, new SimpleBlockFeatureConfig(block))); + } +} diff --git a/MC19.3-19.4/src/main/java/observer/nelle/roses/world/RosesPlacedFeatures.java b/MC19.3-19.4/src/main/java/observer/nelle/roses/world/RosesPlacedFeatures.java new file mode 100644 index 0000000..3460343 --- /dev/null +++ b/MC19.3-19.4/src/main/java/observer/nelle/roses/world/RosesPlacedFeatures.java @@ -0,0 +1,94 @@ +package observer.nelle.roses.world; + +import net.minecraft.registry.Registerable; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; +import net.minecraft.util.Identifier; +import net.minecraft.util.math.intprovider.ClampedIntProvider; +import net.minecraft.util.math.intprovider.UniformIntProvider; +import net.minecraft.world.gen.feature.*; +import net.minecraft.world.gen.placementmodifier.*; +import observer.nelle.roses.RosesModKt; + +import java.util.List; + +public class RosesPlacedFeatures { + + public static final RegistryKey cyanRoseBushPlacedKey = registerKey("cyan_rose_bush_placed"); + + public static final RegistryKey cyanRosePlacedKey = registerKey("cyan_rose_placed"); + public static final RegistryKey rosePlacedKey = registerKey("rose_placed"); + + public static final RegistryKey cyanRoseRarerPlacedKey = registerKey("cyan_rose_rare_placed"); + public static final RegistryKey roseRarerPlacedKey = registerKey("rose_rare_placed"); + + public static final RegistryKey cyanRoseCommonPlacedKey = registerKey("cyan_rose_common_placed"); + public static final RegistryKey roseCommonPlacedKey = registerKey("rose_common_placed"); + + public static void bootstrap(Registerable context) { + var configuredFeatures = context.getRegistryLookup(RegistryKeys.CONFIGURED_FEATURE); + + register(context, cyanRoseBushPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseBushKey), + RarityFilterPlacementModifier.of(85), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + CountPlacementModifier.of(ClampedIntProvider.create(UniformIntProvider.create(-1, 3), 0, 3)), + BiomePlacementModifier.of()); + + // regular + register(context, cyanRosePlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseKey), + RarityFilterPlacementModifier.of(70), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + BiomePlacementModifier.of()); + + register(context, rosePlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.roseKey), + RarityFilterPlacementModifier.of(32), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + BiomePlacementModifier.of()); + + // rarer + register(context, cyanRoseRarerPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseKey), + RarityFilterPlacementModifier.of(90), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + BiomePlacementModifier.of()); + + register(context, roseRarerPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.roseKey), + RarityFilterPlacementModifier.of(80), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + BiomePlacementModifier.of()); + + // more common + register(context, cyanRoseCommonPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.cyanRoseKey), + RarityFilterPlacementModifier.of(45), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + BiomePlacementModifier.of()); + + register(context, roseCommonPlacedKey, configuredFeatures.getOrThrow(RosesConfiguredFeatures.roseKey), + RarityFilterPlacementModifier.of(4), + SquarePlacementModifier.of(), + PlacedFeatures.MOTION_BLOCKING_HEIGHTMAP, + BiomePlacementModifier.of()); + } + + public static RegistryKey registerKey(String name) { + return RegistryKey.of(RegistryKeys.PLACED_FEATURE, Identifier.of(RosesModKt.MOD_ID, name)); + } + + private static void register(Registerable context, RegistryKey key, RegistryEntry> configuration, + List modifiers) { + context.register(key, new PlacedFeature(configuration, List.copyOf(modifiers))); + } + + // may not need this + private static > void register(Registerable context, RegistryKey key, + RegistryEntry> configuration, + PlacementModifier... modifiers) { + register(context, key, configuration, List.of(modifiers)); + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesBlocks.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesBlocks.kt new file mode 100644 index 0000000..dc6b2ff --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesBlocks.kt @@ -0,0 +1,80 @@ +@file:Suppress( + "ktlint:standard:no-wildcard-imports", +) + +package observer.nelle.roses + +import net.minecraft.block.* +import net.minecraft.entity.effect.StatusEffects +import net.minecraft.item.BlockItem +import net.minecraft.item.Item +import net.minecraft.registry.Registries +import net.minecraft.registry.Registry +import net.minecraft.util.Identifier + +object RosesBlocks { + val roseFlower: Block? = + register( + FlowerBlock( + StatusEffects.INSTANT_DAMAGE, + 6, + AbstractBlock.Settings.copy(Blocks.POPPY), + ), + "rose_flower", + true, + ) + val pottedRose: Block? = + register( + FlowerPotBlock( + roseFlower, + AbstractBlock.Settings.copy(Blocks.POTTED_POPPY), + ), + "potted_rose", + false, + ) + val cyanRoseFlower: Block? = + register( + FlowerBlock( + StatusEffects.INSTANT_HEALTH, + 6, + AbstractBlock.Settings.copy(Blocks.POPPY), + ), + "cyan_rose", + true, + ) + val pottedCyan: Block? = + register( + FlowerPotBlock( + cyanRoseFlower, + AbstractBlock.Settings.copy(Blocks.POTTED_POPPY), + ), + "potted_cyan", + false, + ) + val cyanRoseBush: Block? = + register( + TallPlantBlock( + AbstractBlock.Settings.copy(Blocks.LARGE_FERN), + ), + "cyan_rose_bush", + true, + ) + + fun register( + block: Block?, + name: String?, + shouldRegisterItem: Boolean, + ): Block? { + // Register the block and its item. + val id: Identifier? = Identifier.of(MOD_ID, name) + + // Sometimes, you may not want to register an item for the block. + // Eg: if it's a technical block like `minecraft:air` or `minecraft:end_gateway` + if (shouldRegisterItem) { + val blockItem = BlockItem(block, Item.Settings()) + Registry.register(Registries.ITEM, id, blockItem) + } + + return Registry.register(Registries.BLOCK, id, block) + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesCreativeTab.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesCreativeTab.kt new file mode 100644 index 0000000..c9de8eb --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesCreativeTab.kt @@ -0,0 +1,37 @@ +package observer.nelle.roses + +import net.fabricmc.fabric.api.itemgroup.v1.FabricItemGroupEntries +import net.fabricmc.fabric.api.itemgroup.v1.ItemGroupEvents +import net.minecraft.item.ItemGroups +import net.minecraft.item.Items + +object RosesCreativeTab { + // CREATIVE TABS + val roseTabEntry = + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register( + ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries -> + content.addAfter( + Items.POPPY, + RosesBlocks.roseFlower, + ) + }, + ) + val cyanTabEntry = + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register( + ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries -> + content.addAfter( + Items.BLUE_ORCHID, + RosesBlocks.cyanRoseFlower, + ) + }, + ) + val cyanBushTabEntry = + ItemGroupEvents.modifyEntriesEvent(ItemGroups.NATURAL).register( + ItemGroupEvents.ModifyEntries { content: FabricItemGroupEntries -> + content.addAfter( + Items.ROSE_BUSH, + RosesBlocks.cyanRoseBush, + ) + }, + ) +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesMod.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesMod.kt new file mode 100644 index 0000000..944bc86 --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesMod.kt @@ -0,0 +1,24 @@ +package observer.nelle.roses + +import net.fabricmc.api.ModInitializer +import observer.nelle.roses.world.gen.RosesWorldGeneration +import org.slf4j.Logger +import org.slf4j.LoggerFactory + +val LOGGER: Logger = LoggerFactory.getLogger("roses") +const val MOD_ID = "roses_mod" + +class Roses : ModInitializer { + override fun onInitialize() { + LOGGER.info("just like old times?") + + // blocks + RosesBlocks + + // creative tab entries + RosesCreativeTab + + // generation + RosesWorldGeneration.generateRosesWorldGen() + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesModClient.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesModClient.kt new file mode 100644 index 0000000..8df8458 --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/RosesModClient.kt @@ -0,0 +1,20 @@ +package observer.nelle.roses + +import net.fabricmc.api.ClientModInitializer +import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap +import net.minecraft.client.render.RenderLayer +import observer.nelle.roses.RosesBlocks.cyanRoseBush +import observer.nelle.roses.RosesBlocks.cyanRoseFlower +import observer.nelle.roses.RosesBlocks.pottedCyan +import observer.nelle.roses.RosesBlocks.pottedRose +import observer.nelle.roses.RosesBlocks.roseFlower + +class RosesModClient : ClientModInitializer { + override fun onInitializeClient() { + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), cyanRoseBush) + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), cyanRoseFlower) + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), pottedCyan) + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), pottedRose) + BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), roseFlower) + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesBlockTagProvider.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesBlockTagProvider.kt new file mode 100644 index 0000000..1adc88e --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesBlockTagProvider.kt @@ -0,0 +1,30 @@ +package observer.nelle.roses.datagen + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput +import net.fabricmc.fabric.api.datagen.v1.provider.FabricTagProvider +import net.minecraft.registry.RegistryWrapper +import net.minecraft.registry.tag.BlockTags +import observer.nelle.roses.RosesBlocks.cyanRoseBush +import observer.nelle.roses.RosesBlocks.cyanRoseFlower +import observer.nelle.roses.RosesBlocks.pottedCyan +import observer.nelle.roses.RosesBlocks.pottedRose +import observer.nelle.roses.RosesBlocks.roseFlower +import java.util.concurrent.CompletableFuture + +class RosesBlockTagProvider( + output: FabricDataOutput, + registriesFuture: CompletableFuture?, +) : FabricTagProvider.BlockTagProvider(output, registriesFuture) { + override fun configure(wrapperLookup: RegistryWrapper.WrapperLookup) { + getOrCreateTagBuilder(BlockTags.TALL_FLOWERS) + .add(cyanRoseBush) + + getOrCreateTagBuilder(BlockTags.SMALL_FLOWERS) + .add(roseFlower) + .add(cyanRoseFlower) + + getOrCreateTagBuilder(BlockTags.FLOWER_POTS) + .add(pottedRose) + .add(pottedCyan) + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesLootTableProvider.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesLootTableProvider.kt new file mode 100644 index 0000000..149b00a --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesLootTableProvider.kt @@ -0,0 +1,61 @@ +package observer.nelle.roses.datagen + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput +import net.fabricmc.fabric.api.datagen.v1.provider.FabricBlockLootTableProvider +import net.minecraft.block.Block +import net.minecraft.block.Blocks +import net.minecraft.enchantment.Enchantments +import net.minecraft.loot.LootTable +import net.minecraft.loot.entry.ItemEntry +import net.minecraft.loot.function.ApplyBonusLootFunction +import net.minecraft.loot.function.SetCountLootFunction +import net.minecraft.loot.provider.number.UniformLootNumberProvider +import net.minecraft.registry.RegistryWrapper +import observer.nelle.roses.RosesBlocks.cyanRoseBush +import observer.nelle.roses.RosesBlocks.cyanRoseFlower +import observer.nelle.roses.RosesBlocks.pottedCyan +import observer.nelle.roses.RosesBlocks.pottedRose +import observer.nelle.roses.RosesBlocks.roseFlower +import java.util.concurrent.CompletableFuture + +class RosesLootTableProvider( + dataOutput: FabricDataOutput?, + registryLookup: CompletableFuture?, +) : FabricBlockLootTableProvider(dataOutput) { + override fun generate() { + addDrop(roseFlower) + addDrop(cyanRoseFlower) + + addPottedPlantDrops(pottedRose) + addPottedPlantDrops(pottedCyan) + + addDrop( + Blocks.ROSE_BUSH, + roseBushDrops( + Blocks.ROSE_BUSH, + roseFlower, + 2.0f, + 5.0f, + ), + ) + addDrop(cyanRoseBush, roseBushDrops(cyanRoseBush!!, cyanRoseFlower, 2.0f, 5.0f)) + } + + private fun roseBushDrops( + input: Block, + output: Block?, + min: Float, + max: Float, + ): LootTable.Builder = + dropsWithShears( + input, + this + .applyExplosionDecay( + input, + ItemEntry + .builder(output) + .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(min, max))) + .apply(ApplyBonusLootFunction.oreDrops(Enchantments.FORTUNE)), + ), + ) +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesRecipeProvider.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesRecipeProvider.kt new file mode 100644 index 0000000..0f514e9 --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesRecipeProvider.kt @@ -0,0 +1,50 @@ +@file:Suppress("ktlint:standard:no-wildcard-imports") + +package observer.nelle.roses.datagen + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput +import net.fabricmc.fabric.api.datagen.v1.provider.FabricRecipeProvider +import net.minecraft.data.server.recipe.RecipeJsonProvider +import net.minecraft.item.Items +import net.minecraft.recipe.book.RecipeCategory +import net.minecraft.registry.RegistryWrapper +import observer.nelle.roses.RosesBlocks.cyanRoseBush +import observer.nelle.roses.RosesBlocks.cyanRoseFlower +import observer.nelle.roses.RosesBlocks.roseFlower +import java.util.* +import java.util.concurrent.CompletableFuture +import java.util.function.Consumer + +class RosesRecipeProvider( + output: FabricDataOutput, + registriesFuture: CompletableFuture?, +) : FabricRecipeProvider(output) { + override fun generate(recipeExporter: Consumer) { + offerShapelessRecipe( + recipeExporter, + Items.RED_DYE, + Objects.requireNonNull( + roseFlower, + ), + "dye", + 2, + ) + offerShapelessRecipe( + recipeExporter, + Items.CYAN_DYE, + Objects.requireNonNull( + cyanRoseFlower, + ), + "dye", + 2, + ) + + offer2x2CompactingRecipe(recipeExporter, RecipeCategory.DECORATIONS, Items.ROSE_BUSH, roseFlower) + offer2x2CompactingRecipe( + recipeExporter, + RecipeCategory.DECORATIONS, + cyanRoseBush, + cyanRoseFlower, + ) + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesRegistryGenerator.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesRegistryGenerator.kt new file mode 100644 index 0000000..3c8e5e1 --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/datagen/RosesRegistryGenerator.kt @@ -0,0 +1,22 @@ +package observer.nelle.roses.datagen + +import net.fabricmc.fabric.api.datagen.v1.FabricDataOutput +import net.fabricmc.fabric.api.datagen.v1.provider.FabricDynamicRegistryProvider +import net.minecraft.registry.RegistryKeys +import net.minecraft.registry.RegistryWrapper +import java.util.concurrent.CompletableFuture + +class RosesRegistryGenerator( + output: FabricDataOutput?, + registriesFuture: CompletableFuture?, +) : FabricDynamicRegistryProvider(output, registriesFuture) { + override fun configure( + registries: RegistryWrapper.WrapperLookup, + entries: Entries, + ) { + entries.addAll(registries.getWrapperOrThrow(RegistryKeys.CONFIGURED_FEATURE)) + entries.addAll(registries.getWrapperOrThrow(RegistryKeys.PLACED_FEATURE)) + } + + override fun getName(): String = "" +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/world/gen/RosesVegetationGeneration.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/world/gen/RosesVegetationGeneration.kt new file mode 100644 index 0000000..8b41fd2 --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/world/gen/RosesVegetationGeneration.kt @@ -0,0 +1,148 @@ +package observer.nelle.roses.world.gen + +import net.fabricmc.fabric.api.biome.v1.BiomeModifications +import net.fabricmc.fabric.api.biome.v1.BiomeSelectors +import net.minecraft.world.biome.BiomeKeys +import net.minecraft.world.gen.GenerationStep +import observer.nelle.roses.world.RosesPlacedFeatures + +object RosesVegetationGeneration { + fun generateVegetation() { + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.FOREST, + BiomeKeys.FLOWER_FOREST, + BiomeKeys.BIRCH_FOREST, + BiomeKeys.OLD_GROWTH_BIRCH_FOREST, + BiomeKeys.DARK_FOREST, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.cyanRoseBushPlacedKey, + ) + + // regular + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.PLAINS, + BiomeKeys.SUNFLOWER_PLAINS, + BiomeKeys.MEADOW, // https://minecraft.wiki/w/Flower#Flower_gradients + BiomeKeys.FLOWER_FOREST, // https://minecraft.wiki/w/Flower#Flower_gradients + BiomeKeys.SNOWY_PLAINS, + BiomeKeys.FOREST, + BiomeKeys.BIRCH_FOREST, + BiomeKeys.OLD_GROWTH_BIRCH_FOREST, + BiomeKeys.TAIGA, + BiomeKeys.OLD_GROWTH_PINE_TAIGA, + BiomeKeys.OLD_GROWTH_SPRUCE_TAIGA, + BiomeKeys.SNOWY_TAIGA, + BiomeKeys.DARK_FOREST, + BiomeKeys.WINDSWEPT_HILLS, + BiomeKeys.WINDSWEPT_FOREST, + BiomeKeys.WINDSWEPT_GRAVELLY_HILLS, + BiomeKeys.RIVER, + BiomeKeys.FROZEN_RIVER, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.cyanRosePlacedKey, + ) + + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.PLAINS, + BiomeKeys.SUNFLOWER_PLAINS, + BiomeKeys.MEADOW, // https://minecraft.wiki/w/Flower#Flower_gradients + BiomeKeys.FLOWER_FOREST, // https://minecraft.wiki/w/Flower#Flower_gradients + BiomeKeys.SNOWY_PLAINS, + BiomeKeys.FOREST, + BiomeKeys.BIRCH_FOREST, + BiomeKeys.OLD_GROWTH_BIRCH_FOREST, + BiomeKeys.TAIGA, + BiomeKeys.OLD_GROWTH_PINE_TAIGA, + BiomeKeys.OLD_GROWTH_SPRUCE_TAIGA, + BiomeKeys.SNOWY_TAIGA, + BiomeKeys.DARK_FOREST, + BiomeKeys.WINDSWEPT_HILLS, + BiomeKeys.WINDSWEPT_FOREST, + BiomeKeys.WINDSWEPT_GRAVELLY_HILLS, + BiomeKeys.RIVER, + BiomeKeys.FROZEN_RIVER, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.rosePlacedKey, + ) + + // rarer + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.BEACH, + BiomeKeys.SNOWY_BEACH, + BiomeKeys.STONY_SHORE, + BiomeKeys.OCEAN, + BiomeKeys.DEEP_COLD_OCEAN, + BiomeKeys.COLD_OCEAN, + BiomeKeys.DEEP_FROZEN_OCEAN, + BiomeKeys.DEEP_LUKEWARM_OCEAN, + BiomeKeys.DEEP_OCEAN, + BiomeKeys.FROZEN_OCEAN, + BiomeKeys.LUKEWARM_OCEAN, + BiomeKeys.WARM_OCEAN, + BiomeKeys.DESERT, + BiomeKeys.ICE_SPIKES, + BiomeKeys.DRIPSTONE_CAVES, + BiomeKeys.DEEP_DARK, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.cyanRoseRarerPlacedKey, + ) + + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.BEACH, + BiomeKeys.SNOWY_BEACH, + BiomeKeys.STONY_SHORE, + BiomeKeys.OCEAN, + BiomeKeys.DEEP_COLD_OCEAN, + BiomeKeys.COLD_OCEAN, + BiomeKeys.DEEP_FROZEN_OCEAN, + BiomeKeys.DEEP_LUKEWARM_OCEAN, + BiomeKeys.DEEP_OCEAN, + BiomeKeys.FROZEN_OCEAN, + BiomeKeys.LUKEWARM_OCEAN, + BiomeKeys.WARM_OCEAN, + BiomeKeys.DESERT, + BiomeKeys.ICE_SPIKES, + BiomeKeys.DRIPSTONE_CAVES, + BiomeKeys.DEEP_DARK, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.roseRarerPlacedKey, + ) + + // more common + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.JUNGLE, + BiomeKeys.BAMBOO_JUNGLE, + BiomeKeys.SPARSE_JUNGLE, + BiomeKeys.SAVANNA, + BiomeKeys.SAVANNA_PLATEAU, + BiomeKeys.WINDSWEPT_SAVANNA, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.cyanRoseCommonPlacedKey, + ) + + BiomeModifications.addFeature( + BiomeSelectors.includeByKey( + BiomeKeys.JUNGLE, + BiomeKeys.BAMBOO_JUNGLE, + BiomeKeys.SPARSE_JUNGLE, + BiomeKeys.SAVANNA, + BiomeKeys.SAVANNA_PLATEAU, + BiomeKeys.WINDSWEPT_SAVANNA, + ), + GenerationStep.Feature.VEGETAL_DECORATION, + RosesPlacedFeatures.roseCommonPlacedKey, + ) + } +} diff --git a/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/world/gen/RosesWorldGeneration.kt b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/world/gen/RosesWorldGeneration.kt new file mode 100644 index 0000000..60fcfe4 --- /dev/null +++ b/MC19.3-19.4/src/main/kotlin/observer/nelle/roses/world/gen/RosesWorldGeneration.kt @@ -0,0 +1,7 @@ +package observer.nelle.roses.world.gen + +object RosesWorldGeneration { + fun generateRosesWorldGen() { + RosesVegetationGeneration.generateVegetation() + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/cyan_rose.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/cyan_rose.json new file mode 100644 index 0000000..6be127f --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/cyan_rose.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "roses_mod:block/cyan_rose"} + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/cyan_rose_bush.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/cyan_rose_bush.json new file mode 100644 index 0000000..eaf06c4 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/cyan_rose_bush.json @@ -0,0 +1,10 @@ +{ + "variants": { + "half=lower": { + "model": "roses_mod:block/cyan_rose_bush_bottom" + }, + "half=upper": { + "model": "roses_mod:block/cyan_rose_bush_top" + } + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/potted_cyan.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/potted_cyan.json new file mode 100644 index 0000000..dedd97a --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/potted_cyan.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "roses_mod:block/potted_cyan"} + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/potted_rose.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/potted_rose.json new file mode 100644 index 0000000..4f5619d --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/potted_rose.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "roses_mod:block/potted_rose"} + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/rose_flower.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/rose_flower.json new file mode 100644 index 0000000..66aeb91 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/blockstates/rose_flower.json @@ -0,0 +1,5 @@ +{ + "variants": { + "": { "model": "roses_mod:block/rose_flower"} + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/icon.png b/MC19.3-19.4/src/main/resources/assets/roses_mod/icon.png new file mode 100644 index 0000000..38fcde9 Binary files /dev/null and b/MC19.3-19.4/src/main/resources/assets/roses_mod/icon.png differ diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/lang/en_us.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/lang/en_us.json new file mode 100644 index 0000000..3c022ca --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/lang/en_us.json @@ -0,0 +1,7 @@ +{ + "block.roses_mod.rose_flower": "Rose", + "block.roses_mod.potted_rose": "Potted Rose", + "block.roses_mod.cyan_rose": "Cyan Rose", + "block.roses_mod.potted_cyan": "Potted Cyan Rose", + "block.roses_mod.cyan_rose_bush": "Cyan Rose Bush" +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose.json new file mode 100644 index 0000000..4b02866 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "roses_mod:block/cyan_rose" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose_bush_bottom.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose_bush_bottom.json new file mode 100644 index 0000000..95d7c86 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose_bush_bottom.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "roses_mod:block/cyan_rose_bush_bottom" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose_bush_top.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose_bush_top.json new file mode 100644 index 0000000..24e8cb0 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/cyan_rose_bush_top.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "roses_mod:block/cyan_rose_bush_top" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/potted_cyan.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/potted_cyan.json new file mode 100644 index 0000000..8626450 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/potted_cyan.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "roses_mod:block/cyan_rose" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/potted_rose.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/potted_rose.json new file mode 100644 index 0000000..fe3887b --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/potted_rose.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/flower_pot_cross", + "textures": { + "plant": "roses_mod:block/rose_flower" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/rose_flower.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/rose_flower.json new file mode 100644 index 0000000..ba4e661 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/block/rose_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:block/cross", + "textures": { + "cross": "roses_mod:block/rose_flower" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/cyan_rose.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/cyan_rose.json new file mode 100644 index 0000000..90d07d1 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/cyan_rose.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "roses_mod:block/cyan_rose" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/cyan_rose_bush.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/cyan_rose_bush.json new file mode 100644 index 0000000..423fb79 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/cyan_rose_bush.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "roses_mod:block/cyan_rose_bush_top" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/rose_flower.json b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/rose_flower.json new file mode 100644 index 0000000..11dc496 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/assets/roses_mod/models/item/rose_flower.json @@ -0,0 +1,6 @@ +{ + "parent": "item/generated", + "textures": { + "layer0": "roses_mod:block/rose_flower" + } +} diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose.png b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose.png new file mode 100644 index 0000000..b466404 Binary files /dev/null and b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose.png differ diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose_bush_bottom.png b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose_bush_bottom.png new file mode 100644 index 0000000..882a660 Binary files /dev/null and b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose_bush_bottom.png differ diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose_bush_top.png b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose_bush_top.png new file mode 100644 index 0000000..cfe9caa Binary files /dev/null and b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/cyan_rose_bush_top.png differ diff --git a/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/rose_flower.png b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/rose_flower.png new file mode 100644 index 0000000..51d9847 Binary files /dev/null and b/MC19.3-19.4/src/main/resources/assets/roses_mod/textures/block/rose_flower.png differ diff --git a/MC19.3-19.4/src/main/resources/fabric.mod.json b/MC19.3-19.4/src/main/resources/fabric.mod.json new file mode 100644 index 0000000..0e65a13 --- /dev/null +++ b/MC19.3-19.4/src/main/resources/fabric.mod.json @@ -0,0 +1,42 @@ +{ + "schemaVersion": 1, + "id": "roses_mod", + "version": "${version}", + + "name": "Roses Mod", + "description": "Reinstates the classic roses to Minecraft.", + "authors": [ + "nellePoint" + ], + "contact": { + "homepage": "https://modrinth.com/mod/roses-mod", + "issues": "https://git.nullafati.xyz/limepotato/roses-mod/issues", + "sources": "https://git.nullafati.xyz/limepotato/roses-mod" + }, + + "license": "LGPL-3.0", + "icon": "assets/roses_mod/icon.png", + + "environment": "*", + "entrypoints": { + "fabric-datagen": [ + "observer.nelle.roses.RosesDataGenerator" + ], + "client": [ + "observer.nelle.roses.RosesModClient" + ], + "main": [ + "observer.nelle.roses.Roses" + ] + }, + + "mixins": [ + ], + + "depends": { + "fabricloader": ">=${loader_version}", + "fabric-language-kotlin": ">=${kotlin_loader_version}", + "fabric": "*", + "minecraft": "*" + } +} diff --git a/MC20-20.4/gradle.properties b/MC20-20.4/gradle.properties index 4498a34..239bf60 100644 --- a/MC20-20.4/gradle.properties +++ b/MC20-20.4/gradle.properties @@ -9,7 +9,7 @@ org.gradle.jvmargs=-Xmx1G kotlin_loader_version=1.13.0+kotlin.2.1.0 # Mod Properties - mod_version = 2.1+1.20-1.20.4 + mod_version = 2.0+1.20-1.20.4 maven_group = observer.nelle archives_base_name = roses_mod diff --git a/settings.gradle.kts b/settings.gradle.kts index dbf8be2..d5482b3 100644 --- a/settings.gradle.kts +++ b/settings.gradle.kts @@ -33,4 +33,5 @@ plugins { // Learn more about structuring projects with Gradle - https://docs.gradle.org/8.7/userguide/multi_project_builds.html include(":MC20.5-21.1") include(":MC20-20.4") -include("MC21.2-21.4") +include(":MC21.2-21.4") +include(":MC19")