From cf27d619735fd9e462c90b5e79923a5d0a8928eb Mon Sep 17 00:00:00 2001 From: nelle Date: Thu, 19 Dec 2024 15:12:40 -0700 Subject: [PATCH] proper datagen!!!!!!!!!!!!!!! --- .gitignore | 1 + .../loot_tables/blocks/rose_bush.json | 51 +++++++++++++++++++ .../minecraft/tags/blocks/flower_pots.json | 6 +++ .../minecraft/tags/blocks/small_flowers.json | 6 +++ .../minecraft/tags/blocks/tall_flowers.json | 5 ++ .../recipes/decorations/cyan_rose_bush.json | 32 ++++++++++++ .../recipes/decorations/rose_bush.json | 32 ++++++++++++ .../recipes/misc/cyan_dye_from_cyan_rose.json | 32 ++++++++++++ .../misc/red_dye_from_rose_flower.json | 32 ++++++++++++ .../loot_tables/blocks/cyan_rose.json | 20 ++++++++ .../loot_tables/blocks/cyan_rose_bush.json | 51 +++++++++++++++++++ .../loot_tables/blocks/rose_flower.json | 20 ++++++++ .../recipes/cyan_dye_from_cyan_rose.json | 14 +++++ .../roses_mod/recipes/cyan_rose_bush.json | 17 +++++++ .../recipes/red_dye_from_rose_flower.json | 14 +++++ .../data/roses_mod/recipes/rose_bush.json | 17 +++++++ .../datagen/RosesLootTableProvider.java | 8 +-- 17 files changed, 354 insertions(+), 4 deletions(-) create mode 100644 MC1.20.6/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json create mode 100644 MC1.20.6/src/main/generated/data/minecraft/tags/blocks/flower_pots.json create mode 100644 MC1.20.6/src/main/generated/data/minecraft/tags/blocks/small_flowers.json create mode 100644 MC1.20.6/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/rose_flower.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/recipes/cyan_dye_from_cyan_rose.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/recipes/cyan_rose_bush.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/recipes/red_dye_from_rose_flower.json create mode 100644 MC1.20.6/src/main/generated/data/roses_mod/recipes/rose_bush.json diff --git a/.gitignore b/.gitignore index 9623115..5dba4ba 100644 --- a/.gitignore +++ b/.gitignore @@ -13,6 +13,7 @@ MC1.20.6/.gradle/ MC1.20.6/build/ MC1.20.6/out/ MC1.20.6/classes/ +MC1.20.6/src/main/generated/.cache/ MC1.20.6/run/ diff --git a/MC1.20.6/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json b/MC1.20.6/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json new file mode 100644 index 0000000..9a6c3e4 --- /dev/null +++ b/MC1.20.6/src/main/generated/data/minecraft/loot_tables/blocks/rose_bush.json @@ -0,0 +1,51 @@ +{ + "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/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/flower_pots.json b/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/flower_pots.json new file mode 100644 index 0000000..bd69c5f --- /dev/null +++ b/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/flower_pots.json @@ -0,0 +1,6 @@ +{ + "values": [ + "roses_mod:potted_rose", + "roses_mod:potted_cyan" + ] +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/small_flowers.json b/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/small_flowers.json new file mode 100644 index 0000000..766b2c9 --- /dev/null +++ b/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/small_flowers.json @@ -0,0 +1,6 @@ +{ + "values": [ + "roses_mod:rose_flower", + "roses_mod:cyan_rose" + ] +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json b/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json new file mode 100644 index 0000000..1d3fd3f --- /dev/null +++ b/MC1.20.6/src/main/generated/data/minecraft/tags/blocks/tall_flowers.json @@ -0,0 +1,5 @@ +{ + "values": [ + "roses_mod:cyan_rose_bush" + ] +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json new file mode 100644 index 0000000..95dafea --- /dev/null +++ b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/cyan_rose_bush.json @@ -0,0 +1,32 @@ +{ + "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_the_recipe", + "has_cyan_rose" + ] + ], + "rewards": { + "recipes": [ + "roses_mod:cyan_rose_bush" + ] + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json new file mode 100644 index 0000000..f972fee --- /dev/null +++ b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/decorations/rose_bush.json @@ -0,0 +1,32 @@ +{ + "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_the_recipe", + "has_rose_flower" + ] + ], + "rewards": { + "recipes": [ + "minecraft:rose_bush" + ] + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json new file mode 100644 index 0000000..6d240cf --- /dev/null +++ b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/cyan_dye_from_cyan_rose.json @@ -0,0 +1,32 @@ +{ + "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_the_recipe", + "has_cyan_rose" + ] + ], + "rewards": { + "recipes": [ + "minecraft:cyan_dye_from_cyan_rose" + ] + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json new file mode 100644 index 0000000..0337fe5 --- /dev/null +++ b/MC1.20.6/src/main/generated/data/roses_mod/advancements/recipes/misc/red_dye_from_rose_flower.json @@ -0,0 +1,32 @@ +{ + "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_the_recipe", + "has_rose_flower" + ] + ], + "rewards": { + "recipes": [ + "minecraft:red_dye_from_rose_flower" + ] + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose.json b/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose.json new file mode 100644 index 0000000..58b664f --- /dev/null +++ b/MC1.20.6/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/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json b/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json new file mode 100644 index 0000000..faeae85 --- /dev/null +++ b/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/cyan_rose_bush.json @@ -0,0 +1,51 @@ +{ + "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/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/rose_flower.json b/MC1.20.6/src/main/generated/data/roses_mod/loot_tables/blocks/rose_flower.json new file mode 100644 index 0000000..6a1d883 --- /dev/null +++ b/MC1.20.6/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/MC1.20.6/src/main/generated/data/roses_mod/recipes/cyan_dye_from_cyan_rose.json b/MC1.20.6/src/main/generated/data/roses_mod/recipes/cyan_dye_from_cyan_rose.json new file mode 100644 index 0000000..c235327 --- /dev/null +++ b/MC1.20.6/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, + "id": "minecraft:cyan_dye" + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/recipes/cyan_rose_bush.json b/MC1.20.6/src/main/generated/data/roses_mod/recipes/cyan_rose_bush.json new file mode 100644 index 0000000..cdded8d --- /dev/null +++ b/MC1.20.6/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": { + "count": 1, + "id": "roses_mod:cyan_rose_bush" + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/recipes/red_dye_from_rose_flower.json b/MC1.20.6/src/main/generated/data/roses_mod/recipes/red_dye_from_rose_flower.json new file mode 100644 index 0000000..3fa66b1 --- /dev/null +++ b/MC1.20.6/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, + "id": "minecraft:red_dye" + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/generated/data/roses_mod/recipes/rose_bush.json b/MC1.20.6/src/main/generated/data/roses_mod/recipes/rose_bush.json new file mode 100644 index 0000000..2b27ae5 --- /dev/null +++ b/MC1.20.6/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": { + "count": 1, + "id": "minecraft:rose_bush" + } +} \ No newline at end of file diff --git a/MC1.20.6/src/main/java/observer/nelle/roses_mod/datagen/RosesLootTableProvider.java b/MC1.20.6/src/main/java/observer/nelle/roses_mod/datagen/RosesLootTableProvider.java index a22d9cc..e650ec0 100644 --- a/MC1.20.6/src/main/java/observer/nelle/roses_mod/datagen/RosesLootTableProvider.java +++ b/MC1.20.6/src/main/java/observer/nelle/roses_mod/datagen/RosesLootTableProvider.java @@ -26,14 +26,14 @@ public class RosesLootTableProvider extends FabricBlockLootTableProvider { public void generate() { addDrop(RosesBlocks.INSTANCE.getRoseFlower()); addDrop(RosesBlocks.INSTANCE.getCyanRoseFlower()); - addDrop(RosesBlocks.INSTANCE.getCyanRoseBush()); addDrop(Blocks.ROSE_BUSH, roseBushDrops(Blocks.ROSE_BUSH, Objects.requireNonNull(RosesBlocks.INSTANCE.getRoseFlower()).asItem(), 2.0F, 5.0F)); + addDrop(RosesBlocks.INSTANCE.getCyanRoseBush(), roseBushDrops(RosesBlocks.INSTANCE.getCyanRoseBush(), Objects.requireNonNull(RosesBlocks.INSTANCE.getCyanRoseFlower()).asItem(), 2.0F, 5.0F)); } - public LootTable.Builder roseBushDrops(Block tallPlant, Item item, Float min, Float max) { - return dropsWithShears(tallPlant, this - .applyExplosionDecay(tallPlant, ItemEntry.builder(item) + public LootTable.Builder roseBushDrops(Block input, Item output, Float min, Float max) { + return dropsWithShears(input, this + .applyExplosionDecay(input, ItemEntry.builder(output) .apply(SetCountLootFunction.builder(UniformLootNumberProvider.create(min, max))) .apply(ApplyBonusLootFunction.oreDrops(Enchantments.FORTUNE)))); }