From f0b78c7a6b1699d14a05444ec04a97a2f8710ab1 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Wed, 11 Jun 2025 18:29:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=AD=A6=E5=99=A8=E9=85=8D?= =?UTF-8?q?=E6=96=B9=E7=94=9F=E6=88=90=E6=96=B9=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 10 +++- .../recipes/combat/glock_17_smithing.json | 32 ++++++++++++ .../recipes/combat/glock_18_smithing.json | 32 ++++++++++++ .../recipes/combat/mp_443_smithing.json | 32 ++++++++++++ .../recipes/combat/trachelium_smithing.json | 32 ++++++++++++ .../recipe/glock_17_smithing.json} | 11 +++-- .../recipe/glock_18_smithing.json} | 11 +++-- .../recipe/mp_443_smithing.json} | 11 +++-- .../recipe/trachelium_smithing.json | 11 +++-- .../datagen/ModRecipeProvider.java | 49 +++++++++++++++++-- 10 files changed, 207 insertions(+), 24 deletions(-) create mode 100644 src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_17_smithing.json create mode 100644 src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_18_smithing.json create mode 100644 src/generated/resources/data/superbwarfare/advancement/recipes/combat/mp_443_smithing.json create mode 100644 src/generated/resources/data/superbwarfare/advancement/recipes/combat/trachelium_smithing.json rename src/{main/resources/data/superbwarfare/recipe/glock17_smithing.json => generated/resources/data/superbwarfare/recipe/glock_17_smithing.json} (94%) rename src/{main/resources/data/superbwarfare/recipe/glock18_smithing.json => generated/resources/data/superbwarfare/recipe/glock_18_smithing.json} (94%) rename src/{main/resources/data/superbwarfare/recipe/mp443_smithing.json => generated/resources/data/superbwarfare/recipe/mp_443_smithing.json} (94%) rename src/{main => generated}/resources/data/superbwarfare/recipe/trachelium_smithing.json (95%) diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 5ca623491..f445576c3 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,7 +1,11 @@ -// 1.21.1 2025-06-12T06:24:20.3703669 Recipes +// 1.21.1 2025-06-12T06:31:28.20299 Recipes 9775e550332c69f1ee2ac4a09834a35db6f6a2ed data/minecraft/recipe/ammo_box_add_ammo.json 9775e550332c69f1ee2ac4a09834a35db6f6a2ed data/minecraft/recipe/ammo_box_extract_ammo.json 2e1d1bbf32801f3d355c0d3f78ebbb1122cebd4c data/minecraft/recipe/potion_mortar_shell.json +c30037a134eee140578bfe17cb395469c84ac0f9 data/superbwarfare/advancement/recipes/combat/glock_17_smithing.json +0510902ee6cd7ffd7b693375191f8015a38ec584 data/superbwarfare/advancement/recipes/combat/glock_18_smithing.json +61837e97c4a1ec268bf3bf5fd9c7d2c5329ec068 data/superbwarfare/advancement/recipes/combat/mp_443_smithing.json +17a7e19e34d86b2bd1bca7633f40f45872f10611 data/superbwarfare/advancement/recipes/combat/trachelium_smithing.json fb31d2e09af64c6a234c0bc43123b95c529babdd data/superbwarfare/advancement/recipes/misc/aa_12_blueprint.json c570eb1f7d03feb4896c5f3aa04279ce23bcd76e data/superbwarfare/advancement/recipes/misc/ak_12_blueprint.json 83f32a7a84d6058870e2fc6e5fa3e4c5ba4c1b69 data/superbwarfare/advancement/recipes/misc/ak_47_blueprint.json @@ -51,7 +55,9 @@ b5a2b05abd0da94388cbd46b73ae1446db0773b4 data/superbwarfare/recipe/annihilator_b cba1ec494c1313b5a84895be16e90a25c0bc754c data/superbwarfare/recipe/bocek_blueprint.json ae7c8b9ef2e97948f11bf753660c4ab4e94930e2 data/superbwarfare/recipe/devotion_blueprint.json 1ca96490a6d317f6bc71e05a2dced261b8790c0b data/superbwarfare/recipe/glock_17_blueprint.json +499cbb24af56a133da435b6e38fe8f9c26862dd2 data/superbwarfare/recipe/glock_17_smithing.json 96eef061bdfc9c777dd50669e797b284db47e6ef data/superbwarfare/recipe/glock_18_blueprint.json +bcf5921618b46ab6b7fbd432cc90b0d2ce350c4d data/superbwarfare/recipe/glock_18_smithing.json d456d459465bfa7338efc37a10ae8797f01111ab data/superbwarfare/recipe/hk_416_blueprint.json c058c56606592457d7fe2bb1ddef5e05abd5a732 data/superbwarfare/recipe/hpj_11_blueprint.json c591aecdf4b5bab7b206160c0c255470fb3d5684 data/superbwarfare/recipe/hunting_rifle_blueprint.json @@ -66,6 +72,7 @@ b899f64ad5e5510e9b900fa5417171f4aae67da8 data/superbwarfare/recipe/mk_42_bluepri 84d9ee65ab0925aaccd3096f798195db59cdaebb data/superbwarfare/recipe/mle_1934_blueprint.json 198ed671f3feaa2011c6b83813e9e6a069d4876b data/superbwarfare/recipe/mosin_nagant_blueprint.json 71ce44b1206bfcb4ad09d682d9107224a16256c4 data/superbwarfare/recipe/mp_443_blueprint.json +277970b96483dff6ab3632c19bb41e65826df7e7 data/superbwarfare/recipe/mp_443_smithing.json df00ef3e60cc91cb273604a3f4efe9e2913694c3 data/superbwarfare/recipe/mp_5_blueprint.json 6f8d226b24413fa9771506e6db21d88231cf8f4f data/superbwarfare/recipe/m_1911_blueprint.json bbd88474774729ec85df44f5f735128e27f1a50a data/superbwarfare/recipe/m_4_blueprint.json @@ -83,4 +90,5 @@ f99ef54062417a7da9882662880469ec1c054d05 data/superbwarfare/recipe/qbz_95_bluepr 940339216a1dc73e8e9f090af1b5a638db81581a data/superbwarfare/recipe/svd_blueprint.json 74f766c560a92652471e00af24019caec23cf85c data/superbwarfare/recipe/taser_blueprint.json 70ce58e30ce229eb6abc9d89ecf9efd4ac52e9dd data/superbwarfare/recipe/trachelium_blueprint.json +92837b92e74b7f08c393616b44eaeb0298317923 data/superbwarfare/recipe/trachelium_smithing.json 3741feed041950f66fa868c1be94b8a682c9cabe data/superbwarfare/recipe/vector_blueprint.json diff --git a/src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_17_smithing.json b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_17_smithing.json new file mode 100644 index 000000000..4b28ab069 --- /dev/null +++ b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_17_smithing.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_glock_17_blueprint": { + "conditions": { + "items": [ + { + "items": "superbwarfare:glock_17_blueprint" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "superbwarfare:glock_17_smithing" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_glock_17_blueprint" + ] + ], + "rewards": { + "recipes": [ + "superbwarfare:glock_17_smithing" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_18_smithing.json b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_18_smithing.json new file mode 100644 index 000000000..07a063e78 --- /dev/null +++ b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/glock_18_smithing.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_glock_18_blueprint": { + "conditions": { + "items": [ + { + "items": "superbwarfare:glock_18_blueprint" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "superbwarfare:glock_18_smithing" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_glock_18_blueprint" + ] + ], + "rewards": { + "recipes": [ + "superbwarfare:glock_18_smithing" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/superbwarfare/advancement/recipes/combat/mp_443_smithing.json b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/mp_443_smithing.json new file mode 100644 index 000000000..1dd5c5c07 --- /dev/null +++ b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/mp_443_smithing.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_mp_443_blueprint": { + "conditions": { + "items": [ + { + "items": "superbwarfare:mp_443_blueprint" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "superbwarfare:mp_443_smithing" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_mp_443_blueprint" + ] + ], + "rewards": { + "recipes": [ + "superbwarfare:mp_443_smithing" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/superbwarfare/advancement/recipes/combat/trachelium_smithing.json b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/trachelium_smithing.json new file mode 100644 index 000000000..e7eff96bb --- /dev/null +++ b/src/generated/resources/data/superbwarfare/advancement/recipes/combat/trachelium_smithing.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_the_recipe": { + "conditions": { + "recipe": "superbwarfare:trachelium_smithing" + }, + "trigger": "minecraft:recipe_unlocked" + }, + "has_trachelium_blueprint": { + "conditions": { + "items": [ + { + "items": "superbwarfare:trachelium_blueprint" + } + ] + }, + "trigger": "minecraft:inventory_changed" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_trachelium_blueprint" + ] + ], + "rewards": { + "recipes": [ + "superbwarfare:trachelium_smithing" + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipe/glock17_smithing.json b/src/generated/resources/data/superbwarfare/recipe/glock_17_smithing.json similarity index 94% rename from src/main/resources/data/superbwarfare/recipe/glock17_smithing.json rename to src/generated/resources/data/superbwarfare/recipe/glock_17_smithing.json index e3ffe6024..16103732d 100644 --- a/src/main/resources/data/superbwarfare/recipe/glock17_smithing.json +++ b/src/generated/resources/data/superbwarfare/recipe/glock_17_smithing.json @@ -1,15 +1,16 @@ { "type": "minecraft:smithing_transform", - "template": { - "item": "superbwarfare:glock_17_blueprint" + "addition": { + "item": "minecraft:iron_ingot" }, "base": { "item": "superbwarfare:common_material_pack" }, - "addition": { - "item": "minecraft:iron_ingot" - }, "result": { + "count": 1, "id": "superbwarfare:glock_17" + }, + "template": { + "item": "superbwarfare:glock_17_blueprint" } } \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipe/glock18_smithing.json b/src/generated/resources/data/superbwarfare/recipe/glock_18_smithing.json similarity index 94% rename from src/main/resources/data/superbwarfare/recipe/glock18_smithing.json rename to src/generated/resources/data/superbwarfare/recipe/glock_18_smithing.json index 38ea67225..23e173384 100644 --- a/src/main/resources/data/superbwarfare/recipe/glock18_smithing.json +++ b/src/generated/resources/data/superbwarfare/recipe/glock_18_smithing.json @@ -1,15 +1,16 @@ { "type": "minecraft:smithing_transform", - "template": { - "item": "superbwarfare:glock_18_blueprint" + "addition": { + "item": "minecraft:gold_ingot" }, "base": { "item": "superbwarfare:rare_material_pack" }, - "addition": { - "item": "minecraft:gold_ingot" - }, "result": { + "count": 1, "id": "superbwarfare:glock_18" + }, + "template": { + "item": "superbwarfare:glock_18_blueprint" } } \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipe/mp443_smithing.json b/src/generated/resources/data/superbwarfare/recipe/mp_443_smithing.json similarity index 94% rename from src/main/resources/data/superbwarfare/recipe/mp443_smithing.json rename to src/generated/resources/data/superbwarfare/recipe/mp_443_smithing.json index c7f80687d..eab6b3624 100644 --- a/src/main/resources/data/superbwarfare/recipe/mp443_smithing.json +++ b/src/generated/resources/data/superbwarfare/recipe/mp_443_smithing.json @@ -1,15 +1,16 @@ { "type": "minecraft:smithing_transform", - "template": { - "item": "superbwarfare:mp_443_blueprint" + "addition": { + "item": "minecraft:iron_ingot" }, "base": { "item": "superbwarfare:common_material_pack" }, - "addition": { - "item": "minecraft:iron_ingot" - }, "result": { + "count": 1, "id": "superbwarfare:mp_443" + }, + "template": { + "item": "superbwarfare:mp_443_blueprint" } } \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipe/trachelium_smithing.json b/src/generated/resources/data/superbwarfare/recipe/trachelium_smithing.json similarity index 95% rename from src/main/resources/data/superbwarfare/recipe/trachelium_smithing.json rename to src/generated/resources/data/superbwarfare/recipe/trachelium_smithing.json index 4f4cc9a48..c5e4dc9c3 100644 --- a/src/main/resources/data/superbwarfare/recipe/trachelium_smithing.json +++ b/src/generated/resources/data/superbwarfare/recipe/trachelium_smithing.json @@ -1,15 +1,16 @@ { "type": "minecraft:smithing_transform", - "template": { - "item": "superbwarfare:trachelium_blueprint" + "addition": { + "tag": "superbwarfare:ingots/cemented_carbide" }, "base": { "item": "superbwarfare:epic_material_pack" }, - "addition": { - "tag": "superbwarfare:ingots/cemented_carbide" - }, "result": { + "count": 1, "id": "superbwarfare:trachelium" + }, + "template": { + "item": "superbwarfare:trachelium_blueprint" } } \ No newline at end of file diff --git a/src/main/java/com/atsuishio/superbwarfare/datagen/ModRecipeProvider.java b/src/main/java/com/atsuishio/superbwarfare/datagen/ModRecipeProvider.java index 160eedd2b..414a9f11a 100644 --- a/src/main/java/com/atsuishio/superbwarfare/datagen/ModRecipeProvider.java +++ b/src/main/java/com/atsuishio/superbwarfare/datagen/ModRecipeProvider.java @@ -1,15 +1,18 @@ package com.atsuishio.superbwarfare.datagen; +import com.atsuishio.superbwarfare.Mod; import com.atsuishio.superbwarfare.init.ModItems; +import com.atsuishio.superbwarfare.init.ModTags; import com.atsuishio.superbwarfare.recipe.AmmoBoxAddAmmoRecipe; import com.atsuishio.superbwarfare.recipe.AmmoBoxExtractAmmoRecipe; import com.atsuishio.superbwarfare.recipe.PotionMortarShellRecipe; import net.minecraft.core.HolderLookup; import net.minecraft.data.PackOutput; -import net.minecraft.data.recipes.RecipeOutput; -import net.minecraft.data.recipes.RecipeProvider; -import net.minecraft.data.recipes.SpecialRecipeBuilder; +import net.minecraft.data.recipes.*; +import net.minecraft.tags.TagKey; +import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; +import net.minecraft.world.item.crafting.Ingredient; import net.minecraft.world.level.ItemLike; import org.jetbrains.annotations.NotNull; @@ -27,6 +30,12 @@ public class ModRecipeProvider extends RecipeProvider { SpecialRecipeBuilder.special(AmmoBoxAddAmmoRecipe::new).save(output, "ammo_box_add_ammo"); SpecialRecipeBuilder.special(AmmoBoxExtractAmmoRecipe::new).save(output, "ammo_box_extract_ammo"); + gunSmithing(output, ModItems.TRACHELIUM_BLUEPRINT.get(), GunRarity.EPIC, ModTags.Items.INGOTS_CEMENTED_CARBIDE, ModItems.TRACHELIUM.get()); + gunSmithing(output, ModItems.GLOCK_17_BLUEPRINT.get(), GunRarity.COMMON, Items.IRON_INGOT, ModItems.GLOCK_17.get()); + gunSmithing(output, ModItems.MP_443_BLUEPRINT.get(), GunRarity.COMMON, Items.IRON_INGOT, ModItems.MP_443.get()); + gunSmithing(output, ModItems.GLOCK_18_BLUEPRINT.get(), GunRarity.RARE, Items.GOLD_INGOT, ModItems.GLOCK_18.get()); +// gunSmithing(writer, ModItems.HUNTING_RIFLE_BLUEPRINT.get(), GunRarity.COMMON, Items.IRON_INGOT, ModItems.HUNTING_RIFLE.get()); + copyBlueprint(output, ModItems.TRACHELIUM_BLUEPRINT.get()); copyBlueprint(output, ModItems.GLOCK_17_BLUEPRINT.get()); copyBlueprint(output, ModItems.MP_443_BLUEPRINT.get()); @@ -73,4 +82,38 @@ public class ModRecipeProvider extends RecipeProvider { private static void copyBlueprint(RecipeOutput output, ItemLike result) { copySmithingTemplate(output, result, Items.LAPIS_LAZULI); } + + public static void gunSmithing(RecipeOutput output, ItemLike blueprint, GunRarity rarity, TagKey tagKey, Item pResultItem) { + gunSmithing(output, blueprint, rarity, Ingredient.of(tagKey), pResultItem); + } + + public static void gunSmithing(RecipeOutput output, ItemLike blueprint, GunRarity rarity, ItemLike ingredient, Item pResultItem) { + gunSmithing(output, blueprint, rarity, Ingredient.of(ingredient), pResultItem); + } + + public static void gunSmithing(RecipeOutput output, ItemLike blueprint, GunRarity rarity, Ingredient ingredient, Item pResultItem) { + ItemLike pack = switch (rarity) { + case COMMON -> ModItems.COMMON_MATERIAL_PACK.get(); + case RARE -> ModItems.RARE_MATERIAL_PACK.get(); + case EPIC -> ModItems.EPIC_MATERIAL_PACK.get(); + case LEGENDARY -> ModItems.LEGENDARY_MATERIAL_PACK.get(); + }; + + SmithingTransformRecipeBuilder.smithing( + Ingredient.of(blueprint), + Ingredient.of(pack), + ingredient, + RecipeCategory.COMBAT, + pResultItem + ) + .unlocks(getHasName(blueprint), has(blueprint)) + .save(output, Mod.loc(getItemName(pResultItem) + "_smithing")); + } + + public enum GunRarity { + COMMON, + RARE, + EPIC, + LEGENDARY, + } }