添加武器配方生成方法
This commit is contained in:
parent
a68625ef96
commit
f0b78c7a6b
10 changed files with 207 additions and 24 deletions
|
@ -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_add_ammo.json
|
||||||
9775e550332c69f1ee2ac4a09834a35db6f6a2ed data/minecraft/recipe/ammo_box_extract_ammo.json
|
9775e550332c69f1ee2ac4a09834a35db6f6a2ed data/minecraft/recipe/ammo_box_extract_ammo.json
|
||||||
2e1d1bbf32801f3d355c0d3f78ebbb1122cebd4c data/minecraft/recipe/potion_mortar_shell.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
|
fb31d2e09af64c6a234c0bc43123b95c529babdd data/superbwarfare/advancement/recipes/misc/aa_12_blueprint.json
|
||||||
c570eb1f7d03feb4896c5f3aa04279ce23bcd76e data/superbwarfare/advancement/recipes/misc/ak_12_blueprint.json
|
c570eb1f7d03feb4896c5f3aa04279ce23bcd76e data/superbwarfare/advancement/recipes/misc/ak_12_blueprint.json
|
||||||
83f32a7a84d6058870e2fc6e5fa3e4c5ba4c1b69 data/superbwarfare/advancement/recipes/misc/ak_47_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
|
cba1ec494c1313b5a84895be16e90a25c0bc754c data/superbwarfare/recipe/bocek_blueprint.json
|
||||||
ae7c8b9ef2e97948f11bf753660c4ab4e94930e2 data/superbwarfare/recipe/devotion_blueprint.json
|
ae7c8b9ef2e97948f11bf753660c4ab4e94930e2 data/superbwarfare/recipe/devotion_blueprint.json
|
||||||
1ca96490a6d317f6bc71e05a2dced261b8790c0b data/superbwarfare/recipe/glock_17_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
|
96eef061bdfc9c777dd50669e797b284db47e6ef data/superbwarfare/recipe/glock_18_blueprint.json
|
||||||
|
bcf5921618b46ab6b7fbd432cc90b0d2ce350c4d data/superbwarfare/recipe/glock_18_smithing.json
|
||||||
d456d459465bfa7338efc37a10ae8797f01111ab data/superbwarfare/recipe/hk_416_blueprint.json
|
d456d459465bfa7338efc37a10ae8797f01111ab data/superbwarfare/recipe/hk_416_blueprint.json
|
||||||
c058c56606592457d7fe2bb1ddef5e05abd5a732 data/superbwarfare/recipe/hpj_11_blueprint.json
|
c058c56606592457d7fe2bb1ddef5e05abd5a732 data/superbwarfare/recipe/hpj_11_blueprint.json
|
||||||
c591aecdf4b5bab7b206160c0c255470fb3d5684 data/superbwarfare/recipe/hunting_rifle_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
|
84d9ee65ab0925aaccd3096f798195db59cdaebb data/superbwarfare/recipe/mle_1934_blueprint.json
|
||||||
198ed671f3feaa2011c6b83813e9e6a069d4876b data/superbwarfare/recipe/mosin_nagant_blueprint.json
|
198ed671f3feaa2011c6b83813e9e6a069d4876b data/superbwarfare/recipe/mosin_nagant_blueprint.json
|
||||||
71ce44b1206bfcb4ad09d682d9107224a16256c4 data/superbwarfare/recipe/mp_443_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
|
df00ef3e60cc91cb273604a3f4efe9e2913694c3 data/superbwarfare/recipe/mp_5_blueprint.json
|
||||||
6f8d226b24413fa9771506e6db21d88231cf8f4f data/superbwarfare/recipe/m_1911_blueprint.json
|
6f8d226b24413fa9771506e6db21d88231cf8f4f data/superbwarfare/recipe/m_1911_blueprint.json
|
||||||
bbd88474774729ec85df44f5f735128e27f1a50a data/superbwarfare/recipe/m_4_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
|
940339216a1dc73e8e9f090af1b5a638db81581a data/superbwarfare/recipe/svd_blueprint.json
|
||||||
74f766c560a92652471e00af24019caec23cf85c data/superbwarfare/recipe/taser_blueprint.json
|
74f766c560a92652471e00af24019caec23cf85c data/superbwarfare/recipe/taser_blueprint.json
|
||||||
70ce58e30ce229eb6abc9d89ecf9efd4ac52e9dd data/superbwarfare/recipe/trachelium_blueprint.json
|
70ce58e30ce229eb6abc9d89ecf9efd4ac52e9dd data/superbwarfare/recipe/trachelium_blueprint.json
|
||||||
|
92837b92e74b7f08c393616b44eaeb0298317923 data/superbwarfare/recipe/trachelium_smithing.json
|
||||||
3741feed041950f66fa868c1be94b8a682c9cabe data/superbwarfare/recipe/vector_blueprint.json
|
3741feed041950f66fa868c1be94b8a682c9cabe data/superbwarfare/recipe/vector_blueprint.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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -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"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"type": "minecraft:smithing_transform",
|
"type": "minecraft:smithing_transform",
|
||||||
"template": {
|
"addition": {
|
||||||
"item": "superbwarfare:glock_17_blueprint"
|
"item": "minecraft:iron_ingot"
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"item": "superbwarfare:common_material_pack"
|
"item": "superbwarfare:common_material_pack"
|
||||||
},
|
},
|
||||||
"addition": {
|
|
||||||
"item": "minecraft:iron_ingot"
|
|
||||||
},
|
|
||||||
"result": {
|
"result": {
|
||||||
|
"count": 1,
|
||||||
"id": "superbwarfare:glock_17"
|
"id": "superbwarfare:glock_17"
|
||||||
|
},
|
||||||
|
"template": {
|
||||||
|
"item": "superbwarfare:glock_17_blueprint"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"type": "minecraft:smithing_transform",
|
"type": "minecraft:smithing_transform",
|
||||||
"template": {
|
"addition": {
|
||||||
"item": "superbwarfare:glock_18_blueprint"
|
"item": "minecraft:gold_ingot"
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"item": "superbwarfare:rare_material_pack"
|
"item": "superbwarfare:rare_material_pack"
|
||||||
},
|
},
|
||||||
"addition": {
|
|
||||||
"item": "minecraft:gold_ingot"
|
|
||||||
},
|
|
||||||
"result": {
|
"result": {
|
||||||
|
"count": 1,
|
||||||
"id": "superbwarfare:glock_18"
|
"id": "superbwarfare:glock_18"
|
||||||
|
},
|
||||||
|
"template": {
|
||||||
|
"item": "superbwarfare:glock_18_blueprint"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"type": "minecraft:smithing_transform",
|
"type": "minecraft:smithing_transform",
|
||||||
"template": {
|
"addition": {
|
||||||
"item": "superbwarfare:mp_443_blueprint"
|
"item": "minecraft:iron_ingot"
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"item": "superbwarfare:common_material_pack"
|
"item": "superbwarfare:common_material_pack"
|
||||||
},
|
},
|
||||||
"addition": {
|
|
||||||
"item": "minecraft:iron_ingot"
|
|
||||||
},
|
|
||||||
"result": {
|
"result": {
|
||||||
|
"count": 1,
|
||||||
"id": "superbwarfare:mp_443"
|
"id": "superbwarfare:mp_443"
|
||||||
|
},
|
||||||
|
"template": {
|
||||||
|
"item": "superbwarfare:mp_443_blueprint"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,16 @@
|
||||||
{
|
{
|
||||||
"type": "minecraft:smithing_transform",
|
"type": "minecraft:smithing_transform",
|
||||||
"template": {
|
"addition": {
|
||||||
"item": "superbwarfare:trachelium_blueprint"
|
"tag": "superbwarfare:ingots/cemented_carbide"
|
||||||
},
|
},
|
||||||
"base": {
|
"base": {
|
||||||
"item": "superbwarfare:epic_material_pack"
|
"item": "superbwarfare:epic_material_pack"
|
||||||
},
|
},
|
||||||
"addition": {
|
|
||||||
"tag": "superbwarfare:ingots/cemented_carbide"
|
|
||||||
},
|
|
||||||
"result": {
|
"result": {
|
||||||
|
"count": 1,
|
||||||
"id": "superbwarfare:trachelium"
|
"id": "superbwarfare:trachelium"
|
||||||
|
},
|
||||||
|
"template": {
|
||||||
|
"item": "superbwarfare:trachelium_blueprint"
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -1,15 +1,18 @@
|
||||||
package com.atsuishio.superbwarfare.datagen;
|
package com.atsuishio.superbwarfare.datagen;
|
||||||
|
|
||||||
|
import com.atsuishio.superbwarfare.Mod;
|
||||||
import com.atsuishio.superbwarfare.init.ModItems;
|
import com.atsuishio.superbwarfare.init.ModItems;
|
||||||
|
import com.atsuishio.superbwarfare.init.ModTags;
|
||||||
import com.atsuishio.superbwarfare.recipe.AmmoBoxAddAmmoRecipe;
|
import com.atsuishio.superbwarfare.recipe.AmmoBoxAddAmmoRecipe;
|
||||||
import com.atsuishio.superbwarfare.recipe.AmmoBoxExtractAmmoRecipe;
|
import com.atsuishio.superbwarfare.recipe.AmmoBoxExtractAmmoRecipe;
|
||||||
import com.atsuishio.superbwarfare.recipe.PotionMortarShellRecipe;
|
import com.atsuishio.superbwarfare.recipe.PotionMortarShellRecipe;
|
||||||
import net.minecraft.core.HolderLookup;
|
import net.minecraft.core.HolderLookup;
|
||||||
import net.minecraft.data.PackOutput;
|
import net.minecraft.data.PackOutput;
|
||||||
import net.minecraft.data.recipes.RecipeOutput;
|
import net.minecraft.data.recipes.*;
|
||||||
import net.minecraft.data.recipes.RecipeProvider;
|
import net.minecraft.tags.TagKey;
|
||||||
import net.minecraft.data.recipes.SpecialRecipeBuilder;
|
import net.minecraft.world.item.Item;
|
||||||
import net.minecraft.world.item.Items;
|
import net.minecraft.world.item.Items;
|
||||||
|
import net.minecraft.world.item.crafting.Ingredient;
|
||||||
import net.minecraft.world.level.ItemLike;
|
import net.minecraft.world.level.ItemLike;
|
||||||
import org.jetbrains.annotations.NotNull;
|
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(AmmoBoxAddAmmoRecipe::new).save(output, "ammo_box_add_ammo");
|
||||||
SpecialRecipeBuilder.special(AmmoBoxExtractAmmoRecipe::new).save(output, "ammo_box_extract_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.TRACHELIUM_BLUEPRINT.get());
|
||||||
copyBlueprint(output, ModItems.GLOCK_17_BLUEPRINT.get());
|
copyBlueprint(output, ModItems.GLOCK_17_BLUEPRINT.get());
|
||||||
copyBlueprint(output, ModItems.MP_443_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) {
|
private static void copyBlueprint(RecipeOutput output, ItemLike result) {
|
||||||
copySmithingTemplate(output, result, Items.LAPIS_LAZULI);
|
copySmithingTemplate(output, result, Items.LAPIS_LAZULI);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void gunSmithing(RecipeOutput output, ItemLike blueprint, GunRarity rarity, TagKey<Item> 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,
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue