diff --git a/common/src/main/java/dev/dubhe/anvilcraft/init/ModItems.java b/common/src/main/java/dev/dubhe/anvilcraft/init/ModItems.java index 35d836a0c..c2c8c0fa7 100644 --- a/common/src/main/java/dev/dubhe/anvilcraft/init/ModItems.java +++ b/common/src/main/java/dev/dubhe/anvilcraft/init/ModItems.java @@ -83,13 +83,13 @@ public void appendHoverText( }) .recipe((ctx, provider) -> ShapedTagRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get().asItem().getDefaultInstance()) - .pattern("AAA") - .pattern(" B ") - .pattern(" B ") - .define('A', Items.AMETHYST_SHARD) - .define('B', Items.STICK) - .unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.AMETHYST_SHARD)) - .save(provider) + .pattern("AAA") + .pattern(" B ") + .pattern(" B ") + .define('A', Items.AMETHYST_SHARD) + .define('B', Items.STICK) + .unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.AMETHYST_SHARD)) + .save(provider) ) .model((ctx, provider) -> provider.handheld(ctx)) .tag(ModItemTags.PICKAXES) @@ -459,9 +459,14 @@ public void appendHoverText( .recipe((ctx, provider) -> ShapedRecipeBuilder.shaped(RecipeCategory.TOOLS, ctx.get()) .pattern("A") .pattern("B") + .pattern("C") .define('A', Items.ANVIL) .define('B', Items.LIGHTNING_ROD) - .unlockedBy("hasitem", RegistrateRecipeProvider.has(Items.LIGHTNING_ROD)) + .define('C', Items.IRON_INGOT) + .unlockedBy(AnvilCraftDatagen.hasItem(Items.ANVIL), RegistrateRecipeProvider.has(Items.ANVIL)) + .unlockedBy(AnvilCraftDatagen.hasItem(Items.LIGHTNING_ROD), + RegistrateRecipeProvider.has(Items.LIGHTNING_ROD)) + .unlockedBy(AnvilCraftDatagen.hasItem(Items.IRON_INGOT), RegistrateRecipeProvider.has(Items.IRON_INGOT)) .save(provider)) .register(); diff --git a/fabric/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json b/fabric/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json index 648b4f671..75b497df3 100644 --- a/fabric/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json +++ b/fabric/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json @@ -1,13 +1,31 @@ { "parent": "minecraft:recipes/root", "criteria": { - "has_the_recipe": { + "has_anvil": { "conditions": { - "recipe": "anvilcraft:anvil_hammer" + "items": [ + { + "items": [ + "minecraft:anvil" + ] + } + ] }, - "trigger": "minecraft:recipe_unlocked" + "trigger": "minecraft:inventory_changed" + }, + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" }, - "hasitem": { + "has_lightning_rod": { "conditions": { "items": [ { @@ -18,11 +36,19 @@ ] }, "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "anvilcraft:anvil_hammer" + }, + "trigger": "minecraft:recipe_unlocked" } }, "requirements": [ [ - "hasitem", + "has_anvil", + "has_lightning_rod", + "has_iron_ingot", "has_the_recipe" ] ], diff --git a/fabric/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json b/fabric/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json index 19fbd2549..625562416 100644 --- a/fabric/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json +++ b/fabric/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json @@ -7,11 +7,15 @@ }, "B": { "item": "minecraft:lightning_rod" + }, + "C": { + "item": "minecraft:iron_ingot" } }, "pattern": [ "A", - "B" + "B", + "C" ], "result": { "item": "anvilcraft:anvil_hammer" diff --git a/forge/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json b/forge/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json index 648b4f671..75b497df3 100644 --- a/forge/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json +++ b/forge/src/generated/resources/data/anvilcraft/advancements/recipes/tools/anvil_hammer.json @@ -1,13 +1,31 @@ { "parent": "minecraft:recipes/root", "criteria": { - "has_the_recipe": { + "has_anvil": { "conditions": { - "recipe": "anvilcraft:anvil_hammer" + "items": [ + { + "items": [ + "minecraft:anvil" + ] + } + ] }, - "trigger": "minecraft:recipe_unlocked" + "trigger": "minecraft:inventory_changed" + }, + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": [ + "minecraft:iron_ingot" + ] + } + ] + }, + "trigger": "minecraft:inventory_changed" }, - "hasitem": { + "has_lightning_rod": { "conditions": { "items": [ { @@ -18,11 +36,19 @@ ] }, "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "anvilcraft:anvil_hammer" + }, + "trigger": "minecraft:recipe_unlocked" } }, "requirements": [ [ - "hasitem", + "has_anvil", + "has_lightning_rod", + "has_iron_ingot", "has_the_recipe" ] ], diff --git a/forge/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json b/forge/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json index 19fbd2549..625562416 100644 --- a/forge/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json +++ b/forge/src/generated/resources/data/anvilcraft/recipes/anvil_hammer.json @@ -7,11 +7,15 @@ }, "B": { "item": "minecraft:lightning_rod" + }, + "C": { + "item": "minecraft:iron_ingot" } }, "pattern": [ "A", - "B" + "B", + "C" ], "result": { "item": "anvilcraft:anvil_hammer" diff --git a/gradle.properties b/gradle.properties index cf1f4babb..4d42da769 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,9 +5,9 @@ minecraft_version=1.20.1 # Mod info mod_id = anvilcraft mod_name = AnvilCraft -mod_description = ... +mod_description = The mod is an anvil-centric vanilla survival expansion mod_license = LGPL-3.0 license -mod_version = 1.2.2 +mod_version = 1.2.3 mod_url = https://github.com/ maven_group=dev.dubhe