添加集装箱配方生成

This commit is contained in:
17146 2025-06-13 20:03:46 +08:00 committed by Light_Quanta
parent f534e6277a
commit 376e09efc3
No known key found for this signature in database
GPG key ID: 11A39A1B8C890959
4 changed files with 74 additions and 10 deletions

View file

@ -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

View file

@ -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"
]
}
}

View file

@ -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"
}
}

View file

@ -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";
}
}