diff --git a/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e b/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e index 523f2a3..b34c1c5 100644 --- a/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e +++ b/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e @@ -1,5 +1,6 @@ -// 1.21 2024-08-29T06:03:27.686323 Tags for minecraft:item mod id lingshi +// 1.21 2024-09-01T03:41:55.3877274 Tags for minecraft:item mod id lingshi 1d6722e1fc6798f76ac5a0b47a05e1d66b36f99b data/lingshi/tags/item/choppingboard_tool.json +f829502f4e85df233d00f37397bcd5bcf9797156 data/neoforge/tags/item/crops/cabbage.json 12ad13636327de1dc80f1d241b2ae2d134cb64fe data/neoforge/tags/item/dough.json 9519c03dece0e01af8a13e365d488256a3748107 data/neoforge/tags/item/flour.json 769d1ceef14cb7c493ce5e9c32d87dbc633472ba data/neoforge/tags/item/knife.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index 7d0d3bc..37f1219 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,7 +1,6 @@ -// 1.21 2024-08-31T01:19:03.5348268 Loot Tables +// 1.21 2024-09-01T03:32:37.3935582 Loot Tables 032b2242788b8411178136ca48214246ef2af8a9 data/lingshi/loot_table/blocks/chopping_board.json 63e60d75a79e0a64eb6338f6bc98dddd6a8d6a0b data/lingshi/loot_table/blocks/cooking_pot.json -39655e82ead021f58f2276f983f45ff52452fa3a data/lingshi/loot_table/blocks/pork_feet_rice.json 67cc122cf5e7e5865ff9bc81fec6e8371225b0d6 data/lingshi/loot_table/blocks/skillet.json ac9b000c0cff0859a940afc1f40de52b939a1c68 data/lingshi/loot_table/blocks/stove.json c843630bb0739aad37078f0119c9cc31f5316c3a data/lingshi/loot_table/blocks/tea_leaf.json diff --git a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 index 00242e7..8aeeb35 100644 --- a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 +++ b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 @@ -1,4 +1,4 @@ -// 1.21 2024-08-31T02:52:29.9900421 Item Models: lingshi +// 1.21 2024-09-01T04:55:30.2853394 Item Models: lingshi 14f86299910462582d98bcf699b35e34c615ee8e assets/lingshi/models/item/cabbage.json 0e18f939d46f6a164584f621fa97b024122785d9 assets/lingshi/models/item/cabbage_leaf.json 0bcbbc8c3377f7b20a37790cc33d36690c2044c7 assets/lingshi/models/item/cabbage_seed.json @@ -17,6 +17,7 @@ b767fc7952daf0eff3485fe4d8c06c5bba930c22 assets/lingshi/models/item/oil_bucket.j 496d711c2d4af0f851d40f859b102da69188089d assets/lingshi/models/item/rice.json abe8ae1523c26af167289fe958382b2477d96ea1 assets/lingshi/models/item/rice_of_ear.json 57cfb1f90de649ab0f56f107cb56e1d0d2f87ae6 assets/lingshi/models/item/rice_seedling.json +9150fce945d22c3c76b946d1aa13a9b16e50dbc3 assets/lingshi/models/item/sauteed_seasonal_vegetable.json cff85c127954ba63ac8129929c0d7346bf8f305d assets/lingshi/models/item/skillet.json da8fb27d7e9b15fbd96ca8a49b328776550bb2b3 assets/lingshi/models/item/spatula.json 24a37cc616a84374e2aa09a4eaee7d756a35fa10 assets/lingshi/models/item/stove.json diff --git a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 index 1257032..1ff4a9e 100644 --- a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 +++ b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 @@ -1,2 +1,2 @@ -// 1.21 2024-08-30T23:36:41.7027359 Languages: zh_cn for mod: lingshi -881d9198efe03b2e63a7b1055a09e0d6e3057727 assets/lingshi/lang/zh_cn.json +// 1.21 2024-09-01T03:32:37.3971029 Languages: zh_cn for mod: lingshi +dd4b2d51488ffbfc9afc7673400b7eaa667d1a98 assets/lingshi/lang/zh_cn.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 9a156af..0e45974 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.21 2024-08-30T23:36:41.69974 Recipes +// 1.21 2024-09-01T04:54:48.0172948 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 @@ -18,6 +18,7 @@ c9b88b929d6f4b7d68c10c6a3915182cb096d363 data/lingshi/advancement/recipes/skille de37dcaf7e9f79459492cd69ddb81d8d27406f99 data/lingshi/advancement/recipes/skillet/cooked_salmon.json e6b8f09f653cc6c1180feb64eaf5b196543ae4f7 data/lingshi/advancement/recipes/skillet/egg_fried_rice.json ee50d7e3c59e644ce93e46945ff090c3c68fda04 data/lingshi/advancement/recipes/skillet/fried_egg.json +e241bb59f1e7d265a9afbd0f38efdc05d5b325eb data/lingshi/advancement/recipes/skillet/sauteed_seasonal_vegetable.json 0e940fa2ba82aed478ee367c4b998f0bc7ead5c3 data/lingshi/advancement/recipes/tools/iron_knife.json e511f76246f906a279fc1ec531922d8f70dfb68c data/lingshi/advancement/recipes/tools/spatula.json bec1047337843fdd073fe87393c3b500ae11a1de data/lingshi/recipe/chopping_board.json @@ -30,7 +31,7 @@ df6343e05449c8aded71e42701d18e37311ea0c9 data/lingshi/recipe/chopping_board/flou 2e23fcd215c647e72e989050fbfe466f419bed56 data/lingshi/recipe/cooking_pot/cooked_rice.json d0f1076aaf14e4191918a911196f1aeac7d7a59d data/lingshi/recipe/cooking_pot/cooked_rice_1.json 1bb4304dfdcc5be7539818738d41ff2c0f17f1b7 data/lingshi/recipe/cooking_pot/cooked_rice_2.json -4c77e464fa5e2780198b39f82b55b36c68346cd6 data/lingshi/recipe/cooking_pot/pork_feet_rice.json +62d3840084dd51eb8b305821add2a3daf75d976d data/lingshi/recipe/cooking_pot/pork_feet_rice.json e6daac4cca245fc9e220e2fcb1f2b27e410ba503 data/lingshi/recipe/iron_knife.json dba470601fa51254c73ae3c63fa858de333a48c2 data/lingshi/recipe/pot_lid.json a0c7fd85028ea7997689d7bc093b9d025c522ea6 data/lingshi/recipe/skillet.json @@ -44,5 +45,6 @@ c60918f7fafeb03f1c8244417c151ea7a5e44a31 data/lingshi/recipe/skillet/cooked_rabb e72067c16cd3f5e2ec6a11abb0c7a9e41d3e3fd4 data/lingshi/recipe/skillet/cooked_salmon.json 1f718cba48b75cc98ae479a6765f76506c0eea3a data/lingshi/recipe/skillet/egg_fried_rice.json 0c39fdabe7970065856b4adc9e9f3eae7690ea2d data/lingshi/recipe/skillet/fried_egg.json +d6c10dbc6bc315bf535eadefcd22f7dcd7fb566d data/lingshi/recipe/skillet/sauteed_seasonal_vegetable.json 3563171190654e76637de2fa78a6c750389674d7 data/lingshi/recipe/spatula.json 94e898969747627f5a3d3be60b0b66fd528c13e9 data/lingshi/recipe/stove.json diff --git a/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 b/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 index 6178b19..887eb92 100644 --- a/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 +++ b/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 @@ -1,2 +1,3 @@ -// 1.21 2024-08-31T02:52:29.9920421 Block States: lingshi +// 1.21 2024-09-01T05:00:59.5506556 Block States: lingshi c5265867b72222a7b9a0c319c8593c91a69953ab assets/lingshi/blockstates/chopping_board.json +cf0f8d1e27a4b3d6af3697ad29c93125328b6213 assets/lingshi/blockstates/sauteed_seasonal_vegetable.json diff --git a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f index 05374af..ff40ff5 100644 --- a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f +++ b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f @@ -1,3 +1,3 @@ -// 1.21 2024-08-30T23:36:41.6977366 Data Maps +// 1.21 2024-09-01T04:54:48.015299 Data Maps f8714336008bf2256e4e28ae34f31dd942431f35 data/lingshi/data_maps/fluid/cooking_food_fliud.json -bc1c7ba60707a60cfeffda40b6186ef095cfe7dc data/lingshi/data_maps/item/cooking_food_item.json +ac182d9d4e03911f431e586748eb0f93a1560f27 data/lingshi/data_maps/item/cooking_food_item.json diff --git a/src/generated/resources/assets/lingshi/blockstates/sauteed_seasonal_vegetable.json b/src/generated/resources/assets/lingshi/blockstates/sauteed_seasonal_vegetable.json new file mode 100644 index 0000000..538100f --- /dev/null +++ b/src/generated/resources/assets/lingshi/blockstates/sauteed_seasonal_vegetable.json @@ -0,0 +1,34 @@ +{ + "variants": { + "amount=0,facing=east": { + "model": "lingshi:block/plate", + "y": 270 + }, + "amount=0,facing=north": { + "model": "lingshi:block/plate", + "y": 180 + }, + "amount=0,facing=south": { + "model": "lingshi:block/plate" + }, + "amount=0,facing=west": { + "model": "lingshi:block/plate", + "y": 90 + }, + "amount=1,facing=east": { + "model": "lingshi:block/sauteed_seasonal_vegetable", + "y": 270 + }, + "amount=1,facing=north": { + "model": "lingshi:block/sauteed_seasonal_vegetable", + "y": 180 + }, + "amount=1,facing=south": { + "model": "lingshi:block/sauteed_seasonal_vegetable" + }, + "amount=1,facing=west": { + "model": "lingshi:block/sauteed_seasonal_vegetable", + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/lingshi/lang/zh_cn.json b/src/generated/resources/assets/lingshi/lang/zh_cn.json index cc081ba..33c95bb 100644 --- a/src/generated/resources/assets/lingshi/lang/zh_cn.json +++ b/src/generated/resources/assets/lingshi/lang/zh_cn.json @@ -5,6 +5,7 @@ "block.lingshi.pork_feet_rice": "猪脚饭", "block.lingshi.rice": "稻米", "block.lingshi.rice_seedling": "稻苗", + "block.lingshi.sauteed_seasonal_vegetable": "炒时蔬", "block.lingshi.skillet": "平底锅", "block.lingshi.stove": "炉灶", "block.lingshi.tea_tree": "茶树", @@ -25,5 +26,5 @@ "item.lingshi.rice_of_ear": "稻穗", "item.lingshi.spatula": "锅铲", "item.lingshi.tea_leaf": "茶叶", - "lingshi.lingshi_tab": "灵食" + "lingshi.lingshi_tab": "零食" } \ No newline at end of file diff --git a/src/generated/resources/assets/lingshi/models/item/sauteed_seasonal_vegetable.json b/src/generated/resources/assets/lingshi/models/item/sauteed_seasonal_vegetable.json new file mode 100644 index 0000000..608ad32 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/sauteed_seasonal_vegetable.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "lingshi:item/sauteed_seasonal_vegetable" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/sauteed_seasonal_vegetable.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/sauteed_seasonal_vegetable.json new file mode 100644 index 0000000..26663eb --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/sauteed_seasonal_vegetable.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "lingshi:skillet" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/sauteed_seasonal_vegetable" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/sauteed_seasonal_vegetable" + ] + } +} \ No newline at end of file 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 7a49a60..5b7cb22 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 @@ -16,6 +16,18 @@ "burnt_time": 20, "cooked_time": 5 }, + "minecraft:beetroot": { + "burnt_time": 12, + "cooked_time": 3 + }, + "minecraft:brown_mushroom": { + "burnt_time": 12, + "cooked_time": 3 + }, + "minecraft:carrot": { + "burnt_time": 12, + "cooked_time": 3 + }, "minecraft:chicken": { "burnt_time": 20, "cooked_time": 5 @@ -44,6 +56,10 @@ "burnt_time": 20, "cooked_time": 5 }, + "minecraft:red_mushroom": { + "burnt_time": 12, + "cooked_time": 3 + }, "minecraft:salmon": { "burnt_time": 20, "cooked_time": 5 diff --git a/src/generated/resources/data/lingshi/recipe/cooking_pot/pork_feet_rice.json b/src/generated/resources/data/lingshi/recipe/cooking_pot/pork_feet_rice.json index 0c5be2b..ad1134e 100644 --- a/src/generated/resources/data/lingshi/recipe/cooking_pot/pork_feet_rice.json +++ b/src/generated/resources/data/lingshi/recipe/cooking_pot/pork_feet_rice.json @@ -26,7 +26,7 @@ "item": "lingshi:pig_feet" } ], - "label": "boil", + "label": "stew", "result": { "count": 2, "id": "lingshi:pork_feet_rice" diff --git a/src/generated/resources/data/lingshi/recipe/skillet/sauteed_seasonal_vegetable.json b/src/generated/resources/data/lingshi/recipe/skillet/sauteed_seasonal_vegetable.json new file mode 100644 index 0000000..1858c7c --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/sauteed_seasonal_vegetable.json @@ -0,0 +1,34 @@ +{ + "type": "lingshi:skillet", + "container": { + "container": { + "count": 1, + "id": "minecraft:bowl" + }, + "stir_fry_count": 2 + }, + "fluid": { + "amount": 100, + "id": "lingshi:oil_source" + }, + "group": "", + "ingredients": [ + { + "tag": "neoforge:crops/cabbage" + }, + { + "item": "minecraft:carrot" + }, + { + "item": "minecraft:beetroot" + }, + { + "tag": "c:mushrooms" + } + ], + "label": "pan_fry", + "result": { + "count": 1, + "id": "lingshi:sauteed_seasonal_vegetable" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/neoforge/tags/item/crops/cabbage.json b/src/generated/resources/data/neoforge/tags/item/crops/cabbage.json new file mode 100644 index 0000000..91313fa --- /dev/null +++ b/src/generated/resources/data/neoforge/tags/item/crops/cabbage.json @@ -0,0 +1,6 @@ +{ + "values": [ + "lingshi:cabbage_leaf", + "lingshi:cabbage" + ] +} \ No newline at end of file diff --git a/src/main/java/mczme/lingshi/common/block/FoodBlock.java b/src/main/java/mczme/lingshi/common/block/FoodBlock.java index 78a346a..a76c1ed 100644 --- a/src/main/java/mczme/lingshi/common/block/FoodBlock.java +++ b/src/main/java/mczme/lingshi/common/block/FoodBlock.java @@ -33,24 +33,24 @@ public class FoodBlock extends Block { public static final IntegerProperty AMOUNT = IntegerProperty.create("amount", 0, 1); public static final VoxelShape SHAPE = Shapes.or(Block.box(6, 0, 6, 10, 1, 10), Block.box(5, 1, 5, 9, 2, 9), - Block.box(2, 2, 2, 14, 6, 14)) ; + Block.box(2, 2, 2, 14, 6, 14)); public FoodBlock(Properties properties) { super(properties); } public ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, BlockHitResult pHitResult) { - if(pState.getValue(AMOUNT) == 0) { + if (pState.getValue(AMOUNT) == 0) { pLevel.destroyBlock(pPos, true); return ItemInteractionResult.SUCCESS; - }else { - if(pPlayer.canEat(false)) { + } else { + if (pPlayer.canEat(false)) { pLevel.setBlock(pPos, pState.setValue(AMOUNT, 0), Block.UPDATE_CLIENTS); - if(pPlayer.hasEffect(ModEffects.GRATIFICATION_EFFECT)){ + if (pPlayer.hasEffect(ModEffects.GRATIFICATION_EFFECT)) { ItemStack itemStack = new ItemStack(pState.getBlock().asItem()); - FoodProperties foodData =itemStack.get(DataComponents.FOOD); - pPlayer.eat(pLevel, itemStack, new FoodProperties.Builder().nutrition(foodData.nutrition()).saturationModifier(foodData.saturation()*2).build()); - }else { + FoodProperties foodData = itemStack.get(DataComponents.FOOD); + pPlayer.eat(pLevel, itemStack, new FoodProperties.Builder().nutrition(foodData.nutrition()).saturationModifier(foodData.saturation() * 2).build()); + } else { pPlayer.eat(pLevel, new ItemStack(pState.getBlock().asItem())); } diff --git a/src/main/java/mczme/lingshi/common/block/PlateFoodBlock.java b/src/main/java/mczme/lingshi/common/block/PlateFoodBlock.java new file mode 100644 index 0000000..563d3ac --- /dev/null +++ b/src/main/java/mczme/lingshi/common/block/PlateFoodBlock.java @@ -0,0 +1,25 @@ +package mczme.lingshi.common.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; + +public class PlateFoodBlock extends FoodBlock { + + public static final VoxelShape SHAPE = Shapes.or(Block.box(2, 0, 2, 14, 3, 14), + Block.box(1,1,1,15,1,15) + ); + + public PlateFoodBlock(Properties properties) { + super(properties); + } + + @Override + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { + return SHAPE; + } +} diff --git a/src/main/java/mczme/lingshi/common/data/BlockStates.java b/src/main/java/mczme/lingshi/common/data/BlockStates.java index c41447e..0729e99 100644 --- a/src/main/java/mczme/lingshi/common/data/BlockStates.java +++ b/src/main/java/mczme/lingshi/common/data/BlockStates.java @@ -12,6 +12,8 @@ import net.neoforged.neoforge.client.model.generators.VariantBlockStateBuilder; import net.neoforged.neoforge.common.data.ExistingFileHelper; +import static mczme.lingshi.common.block.FoodBlock.AMOUNT; + public class BlockStates extends BlockStateProvider { @@ -23,7 +25,7 @@ public BlockStates(PackOutput output, ExistingFileHelper exFileHelper) { protected void registerStatesAndModels() { horizontalBlock(ModBlocks.CHOPPING_BOARD.get(), "block/chopping_board"); -// horizontalBlock(ModBlocks.PORK_FEET_RICE.get(), "block/cooking_pot"); + horizontalBlock(ModBlocks.SAUTEED_SEASONAL_VEGETABLE.get(),"block/plate","block/sauteed_seasonal_vegetable"); } private void horizontalBlock(Block block, String modelLocation) { @@ -35,6 +37,18 @@ private void horizontalBlock(Block block, String modelLocation) { .build()); } + private void horizontalBlock(Block block, String modelLocation_0 ,String modelLocation_1 ) { + VariantBlockStateBuilder variantBuilder = getVariantBuilder(block); + + variantBuilder.forAllStates(state -> { + String modelLocation = state.getValue(AMOUNT)==1?modelLocation_1:modelLocation_0; + return ConfiguredModel.builder() + .modelFile(modelFile(modelLocation)) + .rotationY((int) state.getValue(BlockStateProperties.HORIZONTAL_FACING).toYRot()) + .build(); + }); + } + private ModelFile modelFile(String location) { return new ModelFile.ExistingModelFile(ResourceLocation.fromNamespaceAndPath(lingshi.MODID,location) , models().existingFileHelper); } diff --git a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java index a0a84a0..8b00d69 100644 --- a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java @@ -39,6 +39,10 @@ protected void gather() { addCookingFood(Items.EGG,3,12); addCookingFood(ModItems.PIG_FEET,8,20); addCookingFood(ModItems.CABBAGE_LEAF.get(),3,12); + addCookingFood(Items.CARROT,3,12); + addCookingFood(Items.RED_MUSHROOM,3,12); + addCookingFood(Items.BROWN_MUSHROOM,3,12); + addCookingFood(Items.BEETROOT,3,12); 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/common/data/ItemModels.java b/src/main/java/mczme/lingshi/common/data/ItemModels.java index 43dbb1e..07c42dd 100644 --- a/src/main/java/mczme/lingshi/common/data/ItemModels.java +++ b/src/main/java/mczme/lingshi/common/data/ItemModels.java @@ -20,6 +20,7 @@ protected void registerModels() { basicItem(ModItems.CABBAGE.get()); basicItem(ModItems.CABBAGE_LEAF.get()); basicItem(ModItems.PORK_FEET_RICE.get()); + basicItem(ModItems.SAUTEED_SEASONAL_VEGETABLE.get()); basicItem(ModItems.FRIED_EGG.get()); basicItem(ModItems.COOKED_RICE.get()); diff --git a/src/main/java/mczme/lingshi/common/data/lang/ChineseLanguageProvider.java b/src/main/java/mczme/lingshi/common/data/lang/ChineseLanguageProvider.java index 27c22f2..b2f846c 100644 --- a/src/main/java/mczme/lingshi/common/data/lang/ChineseLanguageProvider.java +++ b/src/main/java/mczme/lingshi/common/data/lang/ChineseLanguageProvider.java @@ -46,6 +46,7 @@ protected void addTranslations() { this.add(ModItems.NOODLES.get(), "面条"); this.add(ModItems.PIG_FEET.get(), "猪蹄"); this.add(ModItems.PORK_FEET_RICE.get(), "猪脚饭"); + this.add(ModItems.SAUTEED_SEASONAL_VEGETABLE.get(),"炒时蔬"); } } diff --git a/src/main/java/mczme/lingshi/common/data/recipe/SkilletRecipeDatagen.java b/src/main/java/mczme/lingshi/common/data/recipe/SkilletRecipeDatagen.java index 7547161..f050b9c 100644 --- a/src/main/java/mczme/lingshi/common/data/recipe/SkilletRecipeDatagen.java +++ b/src/main/java/mczme/lingshi/common/data/recipe/SkilletRecipeDatagen.java @@ -11,11 +11,13 @@ import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; +import net.neoforged.neoforge.common.Tags; import net.neoforged.neoforge.fluids.FluidStack; import java.util.List; import static mczme.lingshi.common.data.recipe.Recipes.has; +import static mczme.lingshi.common.tag.NeoforgeTags.CROPS_CABBAGE; public class SkilletRecipeDatagen { public SkilletRecipeDatagen(RecipeOutput output) { @@ -48,6 +50,10 @@ protected void buildRecipes(RecipeOutput output) { .setLabel(CookingFoodRecipeLabel.PAN_FRY) .setContainer(new SkilletRecipe.SkilletCookingContainer(new ItemStack(Items.BOWL),3)) .save(output,create("egg_fried_rice")); + build(List.of(Ingredient.of(CROPS_CABBAGE),Ingredient.of(Items.CARROT),Ingredient.of(Items.BEETROOT),Ingredient.of(Tags.Items.MUSHROOMS)),new FluidStack(ModFluids.OIL_SOURCE.get(),100),new ItemStack(ModItems.SAUTEED_SEASONAL_VEGETABLE.get())) + .setLabel(CookingFoodRecipeLabel.PAN_FRY) + .setContainer(new SkilletRecipe.SkilletCookingContainer(new ItemStack(Items.BOWL),2)) + .save(output,create("sauteed_seasonal_vegetable")); // 煮 } diff --git a/src/main/java/mczme/lingshi/common/data/tag/ItemTags.java b/src/main/java/mczme/lingshi/common/data/tag/ItemTags.java index b50dc82..0998593 100644 --- a/src/main/java/mczme/lingshi/common/data/tag/ItemTags.java +++ b/src/main/java/mczme/lingshi/common/data/tag/ItemTags.java @@ -18,7 +18,6 @@ public class ItemTags extends ItemTagsProvider { - public ItemTags(PackOutput pOutput, CompletableFuture pLookupProvider, CompletableFuture> pBlockTags, @Nullable ExistingFileHelper existingFileHelper) { super(pOutput, pLookupProvider, pBlockTags, lingshi.MODID, existingFileHelper); } @@ -31,5 +30,7 @@ protected void addTags(HolderLookup.@NotNull Provider pProvider) { this.tag(FLOUR).add(ModItems.FLOUR.get()); this.tag(DOUGH).add(ModItems.DOUGH.get()); this.tag(NOODLES).add(ModItems.NOODLES.get()); + + this.tag(CROPS_CABBAGE).add(ModItems.CABBAGE_LEAF.get(),ModItems.CABBAGE.get()); } } diff --git a/src/main/java/mczme/lingshi/common/registry/ModBlocks.java b/src/main/java/mczme/lingshi/common/registry/ModBlocks.java index c75b0e5..e70acc6 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModBlocks.java +++ b/src/main/java/mczme/lingshi/common/registry/ModBlocks.java @@ -43,7 +43,8 @@ public class ModBlocks { public static final Supplier OIL_LIQUID_BLOCK = BLOCKS.register("oil_liquid_block",()->new OilBlock(ModFluids.OIL_SOURCE.get(),BlockBehaviour.Properties.ofFullCopy(Blocks.WATER))); public static final Supplier STOVE = BLOCKS.register("stove", ()->new StoveBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.FURNACE))); // 可放置食物 - public static final Supplier PORK_FEET_RICE = BLOCKS.register("pork_feet_rice", ()->new FoodBlock(BlockBehaviour.Properties.of().destroyTime(0.5F))); + public static final Supplier PORK_FEET_RICE = BLOCKS.register("pork_feet_rice", ()->new FoodBlock(BlockBehaviour.Properties.of().destroyTime(0.3F))); + public static final Supplier SAUTEED_SEASONAL_VEGETABLE = BLOCKS.register("sauteed_seasonal_vegetable", ()->new PlateFoodBlock(BlockBehaviour.Properties.of().destroyTime(0.3F))); public static void register(IEventBus modEventBus) { BLOCKS.register(modEventBus); diff --git a/src/main/java/mczme/lingshi/common/registry/ModItems.java b/src/main/java/mczme/lingshi/common/registry/ModItems.java index 9621a49..5ae7ccf 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModItems.java +++ b/src/main/java/mczme/lingshi/common/registry/ModItems.java @@ -6,6 +6,7 @@ import mczme.lingshi.common.item.SpatulaItem; import mczme.lingshi.lingshi; import net.minecraft.world.effect.MobEffectInstance; +import net.minecraft.world.effect.MobEffects; import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.*; import net.neoforged.bus.api.IEventBus; @@ -61,6 +62,9 @@ public class ModItems { 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) .effect(()-> new MobEffectInstance(ModEffects.GRATIFICATION_EFFECT,5*60*20),1.0F).build()))); + public static final Supplier SAUTEED_SEASONAL_VEGETABLE = registerWithCreateTab("sauteed_seasonal_vegetable",()-> new FoodBlockItem(ModBlocks.SAUTEED_SEASONAL_VEGETABLE.get(), new Item.Properties() + .food(new FoodProperties.Builder().usingConvertsTo(Items.BOWL).nutrition(6).saturationModifier(7.2f) + .effect(()-> new MobEffectInstance(MobEffects.DAMAGE_BOOST,60*20,0),1.0F).build()))); private static Supplier registerWithCreateTab(String item_name, Supplier itemSupplier) { Supplier item = ITEMS.register(item_name, itemSupplier); diff --git a/src/main/java/mczme/lingshi/common/tag/NeoforgeTags.java b/src/main/java/mczme/lingshi/common/tag/NeoforgeTags.java index 07aa6a2..b482975 100644 --- a/src/main/java/mczme/lingshi/common/tag/NeoforgeTags.java +++ b/src/main/java/mczme/lingshi/common/tag/NeoforgeTags.java @@ -12,6 +12,8 @@ public class NeoforgeTags { public static final TagKey DOUGH = neoforgeTag(Registries.ITEM, "dough"); public static final TagKey NOODLES = neoforgeTag(Registries.ITEM, "noodles"); + public static final TagKey CROPS_CABBAGE = neoforgeTag(Registries.ITEM, "crops/cabbage"); + private static TagKey neoforgeTag(net.minecraft.resources.ResourceKey> pRegistry, String name) { return TagKey.create(pRegistry, ResourceLocation.fromNamespaceAndPath("neoforge", name)); } diff --git a/src/main/resources/assets/lingshi/models/block/plate.json b/src/main/resources/assets/lingshi/models/block/plate.json new file mode 100644 index 0000000..9b4286e --- /dev/null +++ b/src/main/resources/assets/lingshi/models/block/plate.json @@ -0,0 +1,77 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "lingshi:block/plate", + "particle": "lingshi:block/plate" + }, + "elements": [ + { + "from": [2, 0, 2], + "to": [14, 1, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 7]}, + "faces": { + "north": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "east": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "south": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "west": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "up": {"uv": [0, 0, 12, 12], "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "texture": "#0"} + } + }, + { + "from": [1, 1, 1], + "to": [15, 2, 2], + "faces": { + "north": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "east": {"uv": [13, 12, 14, 13], "texture": "#0"}, + "south": {"uv": [0, 13, 14, 14], "texture": "#0"}, + "west": {"uv": [0, 12, 1, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "down": {"uv": [0, 12, 14, 13], "texture": "#0"} + } + }, + { + "from": [1, 1, 14], + "to": [15, 2, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 13]}, + "faces": { + "north": {"uv": [0, 13, 14, 14], "texture": "#0"}, + "east": {"uv": [0, 12, 1, 13], "texture": "#0"}, + "south": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "west": {"uv": [13, 12, 14, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "down": {"uv": [0, 12, 14, 13], "texture": "#0"} + } + }, + { + "from": [1, 1, 2], + "to": [2, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 0]}, + "faces": { + "east": {"uv": [0, 13, 12, 14], "texture": "#0"}, + "west": {"uv": [0, 12, 12, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 12, 13], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 12, 12, 13], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [14, 1, 2], + "to": [15, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "east": {"uv": [0, 12, 12, 13], "texture": "#0"}, + "west": {"uv": [0, 13, 12, 14], "texture": "#0"}, + "up": {"uv": [0, 12, 12, 13], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 12, 12, 13], "rotation": 270, "texture": "#0"} + } + } + ], + "groups": [ + { + "name": "plate", + "origin": [15, 0, 0], + "color": 0, + "children": [0, 1, 2, 3, 4] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/lingshi/models/block/sauteed_seasonal_vegetable.json b/src/main/resources/assets/lingshi/models/block/sauteed_seasonal_vegetable.json new file mode 100644 index 0000000..6a3ba45 --- /dev/null +++ b/src/main/resources/assets/lingshi/models/block/sauteed_seasonal_vegetable.json @@ -0,0 +1,91 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "lingshi:block/plate", + "1": "lingshi:block/sauteed_seasonal_vegetable", + "particle": "lingshi:block/plate" + }, + "elements": [ + { + "from": [2, 0, 2], + "to": [14, 1, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 0, 7]}, + "faces": { + "north": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "east": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "south": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "west": {"uv": [0, 14, 12, 15], "texture": "#0"}, + "down": {"uv": [0, 0, 12, 12], "texture": "#0"} + } + }, + { + "from": [1, 1, 1], + "to": [15, 2, 2], + "faces": { + "north": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "east": {"uv": [13, 12, 14, 13], "texture": "#0"}, + "west": {"uv": [0, 12, 1, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "down": {"uv": [0, 12, 14, 13], "texture": "#0"} + } + }, + { + "from": [1, 1, 14], + "to": [15, 2, 15], + "rotation": {"angle": 0, "axis": "y", "origin": [0, 0, 13]}, + "faces": { + "east": {"uv": [0, 12, 1, 13], "texture": "#0"}, + "south": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "west": {"uv": [13, 12, 14, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 14, 13], "texture": "#0"}, + "down": {"uv": [0, 12, 14, 13], "texture": "#0"} + } + }, + { + "from": [1, 1, 2], + "to": [2, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 0, 0]}, + "faces": { + "west": {"uv": [0, 12, 12, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 12, 13], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 12, 12, 13], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [14, 1, 2], + "to": [15, 2, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [15, 0, 0]}, + "faces": { + "east": {"uv": [0, 12, 12, 13], "texture": "#0"}, + "up": {"uv": [0, 12, 12, 13], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 12, 12, 13], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [2, 1, 2], + "to": [14, 3, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 1, 2]}, + "faces": { + "north": {"uv": [12, 0, 14, 12], "rotation": 90, "texture": "#1"}, + "east": {"uv": [0, 14, 12, 16], "texture": "#1"}, + "south": {"uv": [0, 0, 12, 2], "texture": "#1"}, + "west": {"uv": [14, 0, 16, 12], "rotation": 90, "texture": "#1"}, + "up": {"uv": [0, 2, 12, 14], "texture": "#1"} + } + } + ], + "groups": [ + { + "name": "plate", + "origin": [15, 0, 0], + "color": 0, + "children": [0, 1, 2, 3, 4] + }, + { + "name": "group", + "origin": [8, 8, 8], + "color": 0, + "children": [5] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/lingshi/textures/block/plate.png b/src/main/resources/assets/lingshi/textures/block/plate.png new file mode 100644 index 0000000..6379207 Binary files /dev/null and b/src/main/resources/assets/lingshi/textures/block/plate.png differ diff --git a/src/main/resources/assets/lingshi/textures/block/sauteed_seasonal_vegetable.png b/src/main/resources/assets/lingshi/textures/block/sauteed_seasonal_vegetable.png new file mode 100644 index 0000000..0868dc6 Binary files /dev/null and b/src/main/resources/assets/lingshi/textures/block/sauteed_seasonal_vegetable.png differ diff --git a/src/main/resources/assets/lingshi/textures/item/sauteed_seasonal_vegetable.png b/src/main/resources/assets/lingshi/textures/item/sauteed_seasonal_vegetable.png new file mode 100644 index 0000000..dfa69bc Binary files /dev/null and b/src/main/resources/assets/lingshi/textures/item/sauteed_seasonal_vegetable.png differ diff --git a/src/main/resources/data/lingshi/loot_table/blocks/sauteed_seasonal_vegetable.json b/src/main/resources/data/lingshi/loot_table/blocks/sauteed_seasonal_vegetable.json new file mode 100644 index 0000000..9a4b9e6 --- /dev/null +++ b/src/main/resources/data/lingshi/loot_table/blocks/sauteed_seasonal_vegetable.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "lingshi:sauteed_seasonal_vegetable", + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "lingshi:sauteed_seasonal_vegetable", + "properties": { + "amount": "1" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:bowl", + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "lingshi:sauteed_seasonal_vegetable", + "properties": { + "amount": "0" + } + } + ] + } + ] + } + ] +}