From 376e09efc36078e997298f8c32f0ee9f7149af02 Mon Sep 17 00:00:00 2001 From: 17146 <1714673995@qq.com> Date: Fri, 13 Jun 2025 20:03:46 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E9=9B=86=E8=A3=85=E7=AE=B1?= =?UTF-8?q?=E9=85=8D=E6=96=B9=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 4 ++- .../transportation/a_10a_container.json | 32 +++++++++++++++++++ .../recipe/a_10a_container.json} | 19 +++++------ .../datagen/ModRecipeProvider.java | 29 +++++++++++++++++ 4 files changed, 74 insertions(+), 10 deletions(-) create mode 100644 src/generated/resources/data/superbwarfare/advancement/recipes/transportation/a_10a_container.json rename src/{main/resources/data/superbwarfare/recipe/a_10a_crafting.json => generated/resources/data/superbwarfare/recipe/a_10a_container.json} (81%) diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 2c5c1a49c..c7d30742d 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.21.1 2025-06-12T21:51:55.0169672 Recipes +// 1.21.1 2025-06-14T09:59:35.2332371 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 @@ -79,6 +79,7 @@ dd88128230882947ff1f7e46ca413e571374cf88 data/superbwarfare/advancement/recipes/ 2a9b21d77cad688c1fb0c924d8be9bb7ded56f0d data/superbwarfare/advancement/recipes/misc/taser_blueprint.json e414607d3519e157842ddb5163a2057b299dd487 data/superbwarfare/advancement/recipes/misc/trachelium_blueprint.json da78113ebbbca910a4517f589a2e3eb110542df9 data/superbwarfare/advancement/recipes/misc/vector_blueprint.json +e9bf9432e482372794a4e9dc378bf7a1564c1c00 data/superbwarfare/advancement/recipes/transportation/a_10a_container.json 7b5f4164c298334f687ffd1ccba9e0cb3b1f2fbc data/superbwarfare/recipe/aa_12_blueprint.json 3ba2ed55215bd31bd922361dd909eec723ec6be5 data/superbwarfare/recipe/aa_12_smithing.json ef7e3adfb75572ee4fcaf87b941636a788e0c430 data/superbwarfare/recipe/ak_12_blueprint.json @@ -88,6 +89,7 @@ abdbcb7a1f69932ffc7f0f3ef6c0ae2200e432b2 data/superbwarfare/recipe/ak_12_smithin b5a2b05abd0da94388cbd46b73ae1446db0773b4 data/superbwarfare/recipe/annihilator_blueprint.json 92bad57a8ae8cda860761a949666d10a975daccd data/superbwarfare/recipe/aurelia_sceptre_blueprint.json 99c73c5ae3eda00a95fb33bca02574abe30112ae data/superbwarfare/recipe/aurelia_sceptre_smithing.json +cce043ab62824b9ea7e3c7005692061eaec50396 data/superbwarfare/recipe/a_10a_container.json cba1ec494c1313b5a84895be16e90a25c0bc754c data/superbwarfare/recipe/bocek_blueprint.json 12953ac27377b7869a68cc67a3874b0e555b381a data/superbwarfare/recipe/bocek_smithing.json ae7c8b9ef2e97948f11bf753660c4ab4e94930e2 data/superbwarfare/recipe/devotion_blueprint.json diff --git a/src/generated/resources/data/superbwarfare/advancement/recipes/transportation/a_10a_container.json b/src/generated/resources/data/superbwarfare/advancement/recipes/transportation/a_10a_container.json new file mode 100644 index 000000000..89ecb0332 --- /dev/null +++ b/src/generated/resources/data/superbwarfare/advancement/recipes/transportation/a_10a_container.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_heavy_armament_module": { + "conditions": { + "items": [ + { + "items": "superbwarfare:heavy_armament_module" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "superbwarfare:a_10a_container" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_heavy_armament_module" + ] + ], + "rewards": { + "recipes": [ + "superbwarfare:a_10a_container" + ] + } +} \ No newline at end of file diff --git a/src/main/resources/data/superbwarfare/recipe/a_10a_crafting.json b/src/generated/resources/data/superbwarfare/recipe/a_10a_container.json similarity index 81% rename from src/main/resources/data/superbwarfare/recipe/a_10a_crafting.json rename to src/generated/resources/data/superbwarfare/recipe/a_10a_container.json index 7fed82631..9081cabe5 100644 --- a/src/main/resources/data/superbwarfare/recipe/a_10a_crafting.json +++ b/src/generated/resources/data/superbwarfare/recipe/a_10a_container.json @@ -1,11 +1,6 @@ { "type": "minecraft:crafting_shaped", "category": "misc", - "pattern": [ - "dad", - "ece", - "fbf" - ], "key": { "a": { "item": "superbwarfare:medium_armament_module" @@ -26,13 +21,19 @@ "item": "superbwarfare:medium_battery_pack" } }, + "pattern": [ + "dad", + "ece", + "fbf" + ], "result": { - "id": "superbwarfare:container", "components": { "minecraft:block_entity_data": { - "id": "superbwarfare:container", - "EntityType": "superbwarfare:a_10a" + "EntityType": "superbwarfare:a_10a", + "id": "superbwarfare:container" } - } + }, + "count": 1, + "id": "superbwarfare:container" } } \ 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 ff3798684..bc51b1397 100644 --- a/src/main/java/com/atsuishio/superbwarfare/datagen/ModRecipeProvider.java +++ b/src/main/java/com/atsuishio/superbwarfare/datagen/ModRecipeProvider.java @@ -1,16 +1,20 @@ package com.atsuishio.superbwarfare.datagen; import com.atsuishio.superbwarfare.Mod; +import com.atsuishio.superbwarfare.init.ModEntities; import com.atsuishio.superbwarfare.init.ModItems; import com.atsuishio.superbwarfare.init.ModTags; +import com.atsuishio.superbwarfare.item.ContainerBlockItem; 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.core.registries.BuiltInRegistries; import net.minecraft.data.PackOutput; import net.minecraft.data.recipes.*; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; +import net.minecraft.world.entity.EntityType; import net.minecraft.world.item.Item; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; @@ -31,6 +35,19 @@ 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"); + containerRecipe(ModEntities.A_10A.get()) + .pattern("dad") + .pattern("ece") + .pattern("fbf") + .define('a', ModItems.MEDIUM_ARMAMENT_MODULE.get()) + .define('b', ModTags.Items.STORAGE_BLOCK_STEEL) + .define('c', ModItems.HEAVY_ARMAMENT_MODULE.get()) + .define('d', ModItems.LARGE_PROPELLER.get()) + .define('e', ModItems.LARGE_MOTOR.get()) + .define('f', ModItems.MEDIUM_BATTERY_PACK.get()) + .unlockedBy(getHasName(ModItems.HEAVY_ARMAMENT_MODULE.get()), has(ModItems.HEAVY_ARMAMENT_MODULE.get())) + .save(output, Mod.loc(getContainerRecipeName(ModEntities.A_10A.get()))); + 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()); @@ -149,4 +166,16 @@ public class ModRecipeProvider extends RecipeProvider { EPIC, LEGENDARY, } + + public static ShapedRecipeBuilder containerRecipe(EntityType type) { + return ShapedRecipeBuilder.shaped(RecipeCategory.TRANSPORTATION, ContainerBlockItem.createInstance(type)); + } + + protected static String getEntityTypeName(EntityType entityType) { + return BuiltInRegistries.ENTITY_TYPE.getKey(entityType).getPath(); + } + + public static String getContainerRecipeName(EntityType entityType) { + return getEntityTypeName(entityType) + "_container"; + } }