diff --git a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 index 279df67..5583a95 100644 --- a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 +++ b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 @@ -1,4 +1,4 @@ -// 1.21 2024-09-13T14:57:21.0680602 Item Models: lingshi +// 1.21 2024-09-13T20:55:00.8813781 Item Models: lingshi 60ca0011c94253a1b7d4c3ca724eb58d73f18691 assets/lingshi/models/item/bean.json 14f86299910462582d98bcf699b35e34c615ee8e assets/lingshi/models/item/cabbage.json 0e18f939d46f6a164584f621fa97b024122785d9 assets/lingshi/models/item/cabbage_leaf.json @@ -26,6 +26,7 @@ abe8ae1523c26af167289fe958382b2477d96ea1 assets/lingshi/models/item/rice_of_ear. cff85c127954ba63ac8129929c0d7346bf8f305d assets/lingshi/models/item/skillet.json dc6ee699f39fab6a9044062b8d26d7b8330a9cd6 assets/lingshi/models/item/sliced_beef.json 44517515349bf9f89ad7329ce4d3d58f7b945229 assets/lingshi/models/item/sliced_pork.json +9234c84174dbf5ddf6402fe0dd6f8dfe30d25aac assets/lingshi/models/item/soybean_milk.json da8fb27d7e9b15fbd96ca8a49b328776550bb2b3 assets/lingshi/models/item/spatula.json eb856ffd13b91d52b910847159984f8a63b35cb5 assets/lingshi/models/item/stewed_noodles.json 24a37cc616a84374e2aa09a4eaee7d756a35fa10 assets/lingshi/models/item/stove.json diff --git a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 index 6bc1835..764de87 100644 --- a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 +++ b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 @@ -1,2 +1,2 @@ -// 1.21 2024-09-13T14:57:21.0710612 Languages: zh_cn for mod: lingshi -ce8c6009186af5edd4da6baae053ee5a9cd2fb5a assets/lingshi/lang/zh_cn.json +// 1.21 2024-09-13T20:55:00.8873792 Languages: zh_cn for mod: lingshi +2e1b4e1f1d8cbf6dafcf7443382ad9b22630f6c0 assets/lingshi/lang/zh_cn.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 81ff871..8bf8572 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,9 +1,10 @@ -// 1.21 2024-09-13T15:50:41.8886655 Recipes +// 1.21 2024-09-13T20:55:00.8843819 Recipes b8cb7428b718c0ca190af49165cd25554d27fa19 data/lingshi/advancement/recipes/cooking_pot/cooked_rice.json 7d0ef4cd02c38f4648e712a935f0ea32fb50aeff data/lingshi/advancement/recipes/cooking_pot/cooked_rice_1.json d918a2369d899974ffa38d6a363553af9e97fdee data/lingshi/advancement/recipes/cooking_pot/cooked_rice_2.json 42b79b899fe026cd628d5838efb759e10b16c7b1 data/lingshi/advancement/recipes/cooking_pot/egg_added_stewed_noodles.json 5cc97ddff81d0a9274cb38f2e28b05aec86be255 data/lingshi/advancement/recipes/cooking_pot/pork_feet_rice.json +f2282549a2b09ff8b2a4a97b401ebb2092fda2a0 data/lingshi/advancement/recipes/cooking_pot/soybean_milk.json b324dfe8c51c5f2f94e08473d966192d14d40c5a data/lingshi/advancement/recipes/cooking_pot/stewed_noodles.json 6a319c97da924f9ab21b5d264c18cb8ad9da8755 data/lingshi/advancement/recipes/decorations/chopping_board.json 316ee6a89da986357d408cff58db9554636fc16a data/lingshi/advancement/recipes/decorations/cooking_pot.json @@ -11,7 +12,7 @@ b324dfe8c51c5f2f94e08473d966192d14d40c5a data/lingshi/advancement/recipes/cookin 0486b842988b1d1ac0abb797a91d26077583679e data/lingshi/advancement/recipes/decorations/pot_lid.json 0a4b54bfda8aa98f1a26bbf1d8231c76ed12e770 data/lingshi/advancement/recipes/decorations/skillet.json 129f0de548d7a7b62ee9dcaeb54da65d7095a009 data/lingshi/advancement/recipes/decorations/stove.json -bb88842bdcc06e396f9884774adfe5f1291ac547 data/lingshi/advancement/recipes/misc/bean.json +bb88842bdcc06e396f9884774adfe5f1291ac547 data/lingshi/advancement/recipes/food/bean.json e4ccb4f32d90b93ef63a3f2a17e843c6a8b2322b data/lingshi/advancement/recipes/skillet/baked_potato.json c9b88b929d6f4b7d68c10c6a3915182cb096d363 data/lingshi/advancement/recipes/skillet/cooked_beef.json 0235c27183fa0a2f93fdf2a6726f2f9d1acc95b7 data/lingshi/advancement/recipes/skillet/cooked_chicken.json @@ -44,6 +45,7 @@ d0f1076aaf14e4191918a911196f1aeac7d7a59d data/lingshi/recipe/cooking_pot/cooked_ 1bb4304dfdcc5be7539818738d41ff2c0f17f1b7 data/lingshi/recipe/cooking_pot/cooked_rice_2.json 9f2a57c63666f89853bc85b73416c4172f4c17bf data/lingshi/recipe/cooking_pot/egg_added_stewed_noodles.json 62d3840084dd51eb8b305821add2a3daf75d976d data/lingshi/recipe/cooking_pot/pork_feet_rice.json +460e18358d7a998d5574bd6aed2192202408654c data/lingshi/recipe/cooking_pot/soybean_milk.json 5cf82cc1c760154fd4fc1c686cae448e40a60903 data/lingshi/recipe/cooking_pot/stewed_noodles.json 6939bc4dbaf8516c0f496369032353a353704949 data/lingshi/recipe/glass_jar.json e6daac4cca245fc9e220e2fcb1f2b27e410ba503 data/lingshi/recipe/iron_knife.json diff --git a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f index b5ff26f..da523a0 100644 --- a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f +++ b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f @@ -1,3 +1,3 @@ -// 1.21 2024-09-12T16:15:54.7791924 Data Maps +// 1.21 2024-09-13T20:55:00.8793789 Data Maps f8714336008bf2256e4e28ae34f31dd942431f35 data/lingshi/data_maps/fluid/cooking_food_fliud.json -394291a8b51d270b730ebfd7af2212d98a518116 data/lingshi/data_maps/item/cooking_food_item.json +3500a223b2700396d3f50a1b3b952210880c5d5f data/lingshi/data_maps/item/cooking_food_item.json diff --git a/src/generated/resources/assets/lingshi/lang/zh_cn.json b/src/generated/resources/assets/lingshi/lang/zh_cn.json index 232cfaa..05dfd0d 100644 --- a/src/generated/resources/assets/lingshi/lang/zh_cn.json +++ b/src/generated/resources/assets/lingshi/lang/zh_cn.json @@ -33,6 +33,7 @@ "item.lingshi.rice_of_ear": "稻穗", "item.lingshi.sliced_beef": "切好的牛肉", "item.lingshi.sliced_pork": "切好的猪肉", + "item.lingshi.soybean_milk": "豆浆", "item.lingshi.spatula": "锅铲", "item.lingshi.tea_leaf": "茶叶", "lingshi.lingshi_tab": "零食" diff --git a/src/generated/resources/assets/lingshi/models/item/soybean_milk.json b/src/generated/resources/assets/lingshi/models/item/soybean_milk.json new file mode 100644 index 0000000..bd10e22 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/soybean_milk.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "lingshi:item/soybean_milk" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/soybean_milk.json b/src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/soybean_milk.json new file mode 100644 index 0000000..c8e10d3 --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/soybean_milk.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_bean": { + "conditions": { + "items": [ + { + "items": "lingshi:bean" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:cooking_pot/soybean_milk" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_bean" + ] + ], + "rewards": { + "recipes": [ + "lingshi:cooking_pot/soybean_milk" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/misc/bean.json b/src/generated/resources/data/lingshi/advancement/recipes/food/bean.json similarity index 100% rename from src/generated/resources/data/lingshi/advancement/recipes/misc/bean.json rename to src/generated/resources/data/lingshi/advancement/recipes/food/bean.json diff --git a/src/generated/resources/data/lingshi/data_maps/item/cooking_food_item.json b/src/generated/resources/data/lingshi/data_maps/item/cooking_food_item.json index e47ee71..d1059e5 100644 --- a/src/generated/resources/data/lingshi/data_maps/item/cooking_food_item.json +++ b/src/generated/resources/data/lingshi/data_maps/item/cooking_food_item.json @@ -1,5 +1,9 @@ { "values": { + "lingshi:bean": { + "burnt_time": 22, + "cooked_time": 8 + }, "lingshi:cabbage_leaf": { "burnt_time": 12, "cooked_time": 3 @@ -75,6 +79,10 @@ "minecraft:salmon": { "burnt_time": 20, "cooked_time": 5 + }, + "minecraft:sugar": { + "burnt_time": 20, + "cooked_time": 2 } } } \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/cooking_pot/soybean_milk.json b/src/generated/resources/data/lingshi/recipe/cooking_pot/soybean_milk.json new file mode 100644 index 0000000..801b597 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/cooking_pot/soybean_milk.json @@ -0,0 +1,34 @@ +{ + "type": "lingshi:cooking_pot", + "container": { + "braising_time": 0, + "container": { + "count": 1, + "id": "minecraft:glass_bottle" + } + }, + "fluid": { + "amount": 1000, + "id": "minecraft:water" + }, + "group": "", + "ingredients": [ + { + "item": "lingshi:bean" + }, + { + "item": "lingshi:bean" + }, + { + "item": "lingshi:bean" + }, + { + "item": "minecraft:sugar" + } + ], + "label": "boil", + "result": { + "count": 4, + "id": "lingshi:soybean_milk" + } +} \ No newline at end of file diff --git a/src/main/java/mczme/lingshi/common/block/entity/ChoppingBoardBlockEntity.java b/src/main/java/mczme/lingshi/common/block/entity/ChoppingBoardBlockEntity.java index e1a9731..b42d299 100644 --- a/src/main/java/mczme/lingshi/common/block/entity/ChoppingBoardBlockEntity.java +++ b/src/main/java/mczme/lingshi/common/block/entity/ChoppingBoardBlockEntity.java @@ -3,7 +3,6 @@ import mczme.lingshi.common.recipe.ChoppingBoardRecipe; import mczme.lingshi.common.registry.BlockEntityTypes; import mczme.lingshi.common.registry.ModRecipes; -import mczme.lingshi.common.tag.ModTags; import net.minecraft.core.BlockPos; import net.minecraft.core.HolderLookup; import net.minecraft.nbt.CompoundTag; @@ -69,18 +68,23 @@ public List getRecipeAndResult(ItemStack tool){ if (level.isClientSide()) { return null; } - if(tool.is(ModTags.ChoppingBoard_TOOL)) { - RecipeManager recipes = level.getRecipeManager(); - Optional> optional = recipes.getRecipeFor( - ModRecipes.CHOPPING_BOARD_RECIPE.get(), - input, - level - ); - return optional - .map(RecipeHolder::value) - .map(e -> e.getResults()) - .orElse(new ArrayList<>()); + RecipeManager recipes = level.getRecipeManager(); + Optional> optional = recipes.getRecipeFor( + ModRecipes.CHOPPING_BOARD_RECIPE.get(), + input, + level + ); + + List result = optional.map(RecipeHolder::value) + .map(e -> e.getResults()) + .orElse(new ArrayList<>()); + Ingredient tool1 = optional.map(RecipeHolder::value) + .map(e -> e.getTool()) + .orElse(Ingredient.EMPTY); + if(!result.isEmpty() && tool1.test(tool)){ + return result; } + return new ArrayList<>(); } diff --git a/src/main/java/mczme/lingshi/common/registry/ModItems.java b/src/main/java/mczme/lingshi/common/registry/ModItems.java index cce6a5f..77fde40 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModItems.java +++ b/src/main/java/mczme/lingshi/common/registry/ModItems.java @@ -65,6 +65,9 @@ public class ModItems { .nutrition(2).saturationModifier(1.2f).build()))); public static final Supplier SLICED_BEEF = registerWithCreateTab("sliced_beef", () -> new Item(new Item.Properties().food(new FoodProperties.Builder() .nutrition(2).saturationModifier(1.2f).build()))); + public static final Supplier SOYBEAN_MILK = registerWithCreateTab("soybean_milk", () -> new Item(new Item.Properties().food(new FoodProperties.Builder() + .nutrition(4).saturationModifier(6f) + .effect(()-> new MobEffectInstance(MobEffects.MOVEMENT_SPEED,5*20),1.0F).build()))); //可放置食物 public static final Supplier PORK_FEET_RICE = registerWithCreateTab("pork_feet_rice", () -> new FoodBlockItem(ModBlocks.PORK_FEET_RICE.get(), new Item.Properties() .food(new FoodProperties.Builder().usingConvertsTo(Items.BOWL).nutrition(12).saturationModifier(9.4f) diff --git a/src/main/java/mczme/lingshi/data/CookingFoodDataGen.java b/src/main/java/mczme/lingshi/data/CookingFoodDataGen.java index d489f3d..5878c2e 100644 --- a/src/main/java/mczme/lingshi/data/CookingFoodDataGen.java +++ b/src/main/java/mczme/lingshi/data/CookingFoodDataGen.java @@ -46,6 +46,8 @@ protected void gather() { addCookingFood(ModItems.NOODLES.get(),5,20); addCookingFood(ModItems.SLICED_PORK.get(),4,15); addCookingFood(ModItems.SLICED_BEEF.get(),4,15); + addCookingFood(ModItems.BEAN.get(),8,22); + addCookingFood(Items.SUGAR,2,20); addCookingFood(Fluids.WATER,15); builder(COOKING_FOOD_FLUID).add(ModFluids.OIL_SOURCE.get().builtInRegistryHolder(), new CookingFoodData(8,30),false); diff --git a/src/main/java/mczme/lingshi/data/ItemModels.java b/src/main/java/mczme/lingshi/data/ItemModels.java index 4d1e8af..a219ce2 100644 --- a/src/main/java/mczme/lingshi/data/ItemModels.java +++ b/src/main/java/mczme/lingshi/data/ItemModels.java @@ -36,6 +36,7 @@ protected void registerModels() { basicItem(ModItems.PIG_FEET.get()); basicItem(ModItems.SLICED_PORK.get()); basicItem(ModItems.SLICED_BEEF.get()); + basicItem(ModItems.SOYBEAN_MILK.get()); basicItem(ModItems.OIL_BUCKET.get()); diff --git a/src/main/java/mczme/lingshi/data/lang/ChineseLanguageProvider.java b/src/main/java/mczme/lingshi/data/lang/ChineseLanguageProvider.java index 1f5e088..f7f62b2 100644 --- a/src/main/java/mczme/lingshi/data/lang/ChineseLanguageProvider.java +++ b/src/main/java/mczme/lingshi/data/lang/ChineseLanguageProvider.java @@ -56,6 +56,7 @@ protected void addTranslations() { this.add(ModItems.FRIED_FISH.get(), "煎鱼"); this.add(ModItems.SLICED_PORK.get(), "切好的猪肉"); this.add(ModItems.SLICED_BEEF.get(), "切好的牛肉"); + this.add(ModItems.SOYBEAN_MILK.get(), "豆浆"); this.add(ModEffects.GRATIFICATION_EFFECT.get(),"满足"); diff --git a/src/main/java/mczme/lingshi/data/recipe/CookingPotRecipeDataGen.java b/src/main/java/mczme/lingshi/data/recipe/CookingPotRecipeDataGen.java index 61411d5..b03ada9 100644 --- a/src/main/java/mczme/lingshi/data/recipe/CookingPotRecipeDataGen.java +++ b/src/main/java/mczme/lingshi/data/recipe/CookingPotRecipeDataGen.java @@ -49,12 +49,20 @@ protected void buildRecipes(RecipeOutput output) { .unlockedBy("has_noodles", has(ModItems.NOODLES.get())) .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),0)) .save(output,create("egg_added_stewed_noodles")); + build(List.of(Ingredient.of(ModItems.BEAN.get()),Ingredient.of(ModItems.BEAN.get()),Ingredient.of(ModItems.BEAN.get()),Ingredient.of(Items.SUGAR)),new FluidStack(Fluids.WATER,1000),new ItemStack(ModItems.SOYBEAN_MILK.get(),4) + ,CookingFoodRecipeLabel.BOIL) + .unlockedBy("has_bean", has(ModItems.BEAN.get())) + .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.GLASS_BOTTLE),0)) + .save(output,create("soybean_milk")); // 炖 build(List.of(Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.CABBAGE_LEAF.get()),Ingredient.of(ModItems.PIG_FEET.get())),new FluidStack(Fluids.WATER,1000),new ItemStack(ModItems.PORK_FEET_RICE.get(),2) ,CookingFoodRecipeLabel.STEW) .unlockedBy("has_pig_feet", has(ModItems.PIG_FEET.get())) .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),5)) .save(output,create("pork_feet_rice")); +// 油炸 + +// 其他 } diff --git a/src/main/resources/assets/lingshi/textures/item/soybean_milk.png b/src/main/resources/assets/lingshi/textures/item/soybean_milk.png new file mode 100644 index 0000000..4e4b088 Binary files /dev/null and b/src/main/resources/assets/lingshi/textures/item/soybean_milk.png differ