From 00447420063dc2c7b5adbb37bd933d1d188b3cb1 Mon Sep 17 00:00:00 2001 From: MCZME <13183052+mczme@user.noreply.gitee.com> Date: Thu, 22 Aug 2024 03:06:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E5=B9=B3=E5=BA=95?= =?UTF-8?q?=E9=94=85=E5=8A=A0=E7=83=AD=E9=85=8D=E6=96=B9=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=EF=BC=8C=E9=A3=9F=E7=89=A9=E7=85=8E=E9=B8=A1=E8=9B=8B=EF=BC=8C?= =?UTF-8?q?=E7=9B=B8=E5=85=B3=E5=90=88=E6=88=90=E8=A1=A8=EF=BC=8C=E6=B8=B2?= =?UTF-8?q?=E6=9F=93=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../58503a955f2b64805747dc412de304e67eaffc8e | 2 +- .../71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 | 3 +- .../85f12f813aff948f91f5cd129c0ffa86bcb17361 | 4 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 36 +++++++++---- .../e0d3d0b8d9c807675613821fa865a35f707cd83f | 4 +- .../resources/assets/lingshi/lang/zh_cn.json | 2 + .../assets/lingshi/models/item/fried_egg.json | 6 +++ .../assets/lingshi/models/item/spatula.json | 6 +++ .../recipes/decorations/chopping_board.json | 32 ++++++++++++ .../recipes/decorations/skillet.json | 32 ++++++++++++ .../recipes/skillet/baked_potato.json | 32 ++++++++++++ .../recipes/skillet/cooked_beef.json | 32 ++++++++++++ .../recipes/skillet/cooked_chicken.json | 32 ++++++++++++ .../recipes/skillet/cooked_cod.json | 32 ++++++++++++ .../recipes/skillet/cooked_mutton.json | 32 ++++++++++++ .../recipes/skillet/cooked_porkchop.json | 32 ++++++++++++ .../recipes/skillet/cooked_rabbit.json | 32 ++++++++++++ .../recipes/skillet/cooked_salmon.json | 32 ++++++++++++ .../recipes/skillet/fried_egg.json | 32 ++++++++++++ .../advancement/recipes/tools/iron_knife.json | 32 ++++++++++++ .../advancement/recipes/tools/spatula.json | 32 ++++++++++++ .../data_maps/fluid/cooking_food_fliud.json | 12 +++++ .../data_maps/item/cooking_food_item.json | 44 ++++++++++++++++ .../data/lingshi/recipe/chopping_board.json | 20 +++++++ .../data/lingshi/recipe/iron_knife.json | 19 +++++++ .../data/lingshi/recipe/skillet.json | 20 +++++++ .../lingshi/recipe/skillet/baked_potato.json | 14 +++++ .../lingshi/recipe/skillet/cooked_beef.json | 14 +++++ .../recipe/skillet/cooked_chicken.json | 14 +++++ .../lingshi/recipe/skillet/cooked_cod.json | 14 +++++ .../lingshi/recipe/skillet/cooked_mutton.json | 14 +++++ .../recipe/skillet/cooked_porkchop.json | 14 +++++ .../lingshi/recipe/skillet/cooked_rabbit.json | 14 +++++ .../lingshi/recipe/skillet/cooked_salmon.json | 14 +++++ .../lingshi/recipe/skillet/fried_egg.json | 18 +++++++ .../data/lingshi/recipe/spatula.json | 21 ++++++++ .../BlockEntityRenderer/SkilletBER.java | 44 +++++++++++++--- .../mczme/lingshi/client/model/ModelMap.java | 28 ++++++++++ .../SkilletRecipeBookComponent.java | 15 ++++++ .../lingshi/client/screen/CookingHud.java | 4 +- .../mczme/lingshi/client/util/RenderUtil.java | 44 ++++++++++++++++ .../lingshi/common/block/SkilletBlock.java | 8 ++- .../common/data/CookingFoodDataGen.java | 15 ++++-- .../mczme/lingshi/common/data/ItemModels.java | 1 + .../data/lang/ChineseLanguageProvider.java | 5 +- .../data/recipe/CraftingRecipeDataGen.java | 49 ++++++++++++++++++ .../lingshi/common/data/recipe/Recipes.java | 1 + .../data/recipe/SkilletRecipeDatagen.java | 45 +++++++++++----- .../mczme/lingshi/common/event/Setup.java | 17 ++++++ .../lingshi/common/registry/ModItems.java | 3 +- .../lingshi/textures/gui/cooking_hud.png | Bin 726 -> 725 bytes .../recipe_book/skillet_filter_disabled.png | Bin 0 -> 400 bytes .../skillet_filter_disabled_highlighted.png | Bin 0 -> 378 bytes .../recipe_book/skillet_filter_enabled.png | Bin 0 -> 375 bytes .../skillet_filter_enabled_highlighted.png | Bin 0 -> 372 bytes .../lingshi/textures/item/fried_egg.png | Bin 0 -> 329 bytes .../lingshi/textures/item/fried_egg_1.png | Bin 0 -> 413 bytes 57 files changed, 982 insertions(+), 42 deletions(-) create mode 100644 src/generated/resources/assets/lingshi/models/item/fried_egg.json create mode 100644 src/generated/resources/assets/lingshi/models/item/spatula.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/decorations/chopping_board.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/decorations/skillet.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/baked_potato.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_beef.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_chicken.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_cod.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_mutton.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_porkchop.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_rabbit.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_salmon.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/skillet/fried_egg.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/tools/iron_knife.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/tools/spatula.json create mode 100644 src/generated/resources/data/lingshi/data_maps/fluid/cooking_food_fliud.json create mode 100644 src/generated/resources/data/lingshi/data_maps/item/cooking_food_item.json create mode 100644 src/generated/resources/data/lingshi/recipe/chopping_board.json create mode 100644 src/generated/resources/data/lingshi/recipe/iron_knife.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/baked_potato.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_beef.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_chicken.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_cod.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_mutton.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_porkchop.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_rabbit.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/cooked_salmon.json create mode 100644 src/generated/resources/data/lingshi/recipe/skillet/fried_egg.json create mode 100644 src/generated/resources/data/lingshi/recipe/spatula.json create mode 100644 src/main/java/mczme/lingshi/client/model/ModelMap.java create mode 100644 src/main/java/mczme/lingshi/client/util/RenderUtil.java create mode 100644 src/main/java/mczme/lingshi/common/data/recipe/CraftingRecipeDataGen.java create mode 100644 src/main/java/mczme/lingshi/common/event/Setup.java create mode 100644 src/main/resources/assets/lingshi/textures/gui/sprites/recipe_book/skillet_filter_disabled.png create mode 100644 src/main/resources/assets/lingshi/textures/gui/sprites/recipe_book/skillet_filter_disabled_highlighted.png create mode 100644 src/main/resources/assets/lingshi/textures/gui/sprites/recipe_book/skillet_filter_enabled.png create mode 100644 src/main/resources/assets/lingshi/textures/gui/sprites/recipe_book/skillet_filter_enabled_highlighted.png create mode 100644 src/main/resources/assets/lingshi/textures/item/fried_egg.png create mode 100644 src/main/resources/assets/lingshi/textures/item/fried_egg_1.png diff --git a/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e b/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e index 283c391..717dcd3 100644 --- a/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e +++ b/src/generated/resources/.cache/58503a955f2b64805747dc412de304e67eaffc8e @@ -1,2 +1,2 @@ -// 1.21 2024-08-11T21:36:53.8731756 Tags for minecraft:item mod id lingshi +// 1.21 2024-08-21T06:28:09.8754652 Tags for minecraft:item mod id lingshi 769d1ceef14cb7c493ce5e9c32d87dbc633472ba data/neoforge/tags/item/knife.json diff --git a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 index 13f47da..63d7859 100644 --- a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 +++ b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 @@ -1,5 +1,6 @@ -// 1.21 2024-08-20T17:21:47.1347182 Item Models: lingshi +// 1.21 2024-08-21T06:28:09.8764642 Item Models: lingshi bad0cb5e093fa42331c2d4a1157d1a7b5b3fc588 assets/lingshi/models/item/chopping_board.json +014b17c43a62c41d623a0d944e434cf1ac3986be assets/lingshi/models/item/fried_egg.json 249957a6811e300efca306db358e468855851d73 assets/lingshi/models/item/iron_knife.json b767fc7952daf0eff3485fe4d8c06c5bba930c22 assets/lingshi/models/item/oil_bucket.json 496d711c2d4af0f851d40f859b102da69188089d assets/lingshi/models/item/rice.json diff --git a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 index 72de2cc..2a23f20 100644 --- a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 +++ b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 @@ -1,2 +1,2 @@ -// 1.21 2024-08-18T21:30:07.1416504 Languages: zh_cn for mod: lingshi -dbec1f3db6638e67900f8e7501a5ca049ec75339 assets/lingshi/lang/zh_cn.json +// 1.21 2024-08-21T06:16:10.9126133 Languages: zh_cn for mod: lingshi +18193d8163c50d2682857150071f4b38892474cb assets/lingshi/lang/zh_cn.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index b4aaaaa..11b4872 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,10 +1,28 @@ -// 1.21 2024-08-20T05:59:15.3133646 Recipes -30317ddefa8c34feeae2fb9b47b40dae9a2c1335 data/lingshi/advancement/recipes/skillet/rice_apple.json -60b5c5b8536660e2fc3758499991b48002d68196 data/lingshi/advancement/recipes/skillet/test01.json -24367c601743c0d2f9df76c4a1e59f6650f0de4a data/lingshi/advancement/recipes/skillet/test02.json -b97f9dc99489844bbfeaf5f329ec4a6e793530d2 data/lingshi/advancement/recipes/skillet/test03.json +// 1.21 2024-08-21T06:32:40.2517736 Recipes +6a319c97da924f9ab21b5d264c18cb8ad9da8755 data/lingshi/advancement/recipes/decorations/chopping_board.json +0a4b54bfda8aa98f1a26bbf1d8231c76ed12e770 data/lingshi/advancement/recipes/decorations/skillet.json +90e465ef819e2007fb2b023b2970095ecce8b79a data/lingshi/advancement/recipes/skillet/baked_potato.json +270b8d1827bb4d94559088a008f9f2b887d3cf79 data/lingshi/advancement/recipes/skillet/cooked_beef.json +3da01b8b1fa7548e7f2b7992450356eed7c3f638 data/lingshi/advancement/recipes/skillet/cooked_chicken.json +61c5eeeda0e4c82b459978a7ace05bac2ae3a724 data/lingshi/advancement/recipes/skillet/cooked_cod.json +0d382e904771b12b539540f8bfe3aba5a316288b data/lingshi/advancement/recipes/skillet/cooked_mutton.json +7dac12da1bf40c7246fff7b3f5d3ad3395ca7fee data/lingshi/advancement/recipes/skillet/cooked_porkchop.json +dd85a62c2968cd2bfa854faa7b3251ec7f3ff3a1 data/lingshi/advancement/recipes/skillet/cooked_rabbit.json +90acc516d2ea75e5ff8ab2117d4570b6f4f37137 data/lingshi/advancement/recipes/skillet/cooked_salmon.json +84acc8c3c7e0177a6a39a017a2b688d9e95c7fbb data/lingshi/advancement/recipes/skillet/fried_egg.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 3e41620c4ec5b19f87046dad7fe5c7ed6ede21c2 data/lingshi/recipe/chopping_board/rice.json -a25f37985d35ec9c738209ef29f82c466a34f01c data/lingshi/recipe/skillet/rice_apple.json -c80602ecff2ea09399aff222a6d36c7b28d0164f data/lingshi/recipe/skillet/test01.json -89bc0e33a11e930f7b69c4d726d92b4f9446b3d3 data/lingshi/recipe/skillet/test02.json -6d216286873ffd9df6b685d798129aa5720e061b data/lingshi/recipe/skillet/test03.json +e6daac4cca245fc9e220e2fcb1f2b27e410ba503 data/lingshi/recipe/iron_knife.json +6971547c4e197d1f259c4599e8bd99fa9a565095 data/lingshi/recipe/skillet.json +26590681b1777b3be492a971dfc95a36af346fee data/lingshi/recipe/skillet/baked_potato.json +91bf1f4b8acf5c536598059691981e665838ea17 data/lingshi/recipe/skillet/cooked_beef.json +27b62cedc03d158bf611f528d405dd7cfe39b429 data/lingshi/recipe/skillet/cooked_chicken.json +88368af861afa365e968533c265c89b65019b049 data/lingshi/recipe/skillet/cooked_cod.json +93fa44daf3296aff85255b2e05a89fda9fbdc69f data/lingshi/recipe/skillet/cooked_mutton.json +920d7c639da2cb840174d1a9c932349a0d85dee5 data/lingshi/recipe/skillet/cooked_porkchop.json +5565fa5a338b2fefe8369d4cec4e28dd7c3481c3 data/lingshi/recipe/skillet/cooked_rabbit.json +524f6c88e228427667c5201e43752957f7bbd649 data/lingshi/recipe/skillet/cooked_salmon.json +1c104eed6daaa90da2777ec06f29089caf0446d3 data/lingshi/recipe/skillet/fried_egg.json +3563171190654e76637de2fa78a6c750389674d7 data/lingshi/recipe/spatula.json diff --git a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f index a599a1a..94d453e 100644 --- a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f +++ b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f @@ -1,3 +1,3 @@ -// 1.21 2024-08-20T05:59:15.3113644 Data Maps +// 1.21 2024-08-21T06:16:10.9086119 Data Maps f8714336008bf2256e4e28ae34f31dd942431f35 data/lingshi/data_maps/fluid/cooking_food_fliud.json -7efa3dffa87b902d4fac709bea335215c17fdf2a data/lingshi/data_maps/item/cooking_food_item.json +0668ddaaa072cb34bd87eb6d4cf07b023dfe3ba7 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 b25846a..8e00060 100644 --- a/src/generated/resources/assets/lingshi/lang/zh_cn.json +++ b/src/generated/resources/assets/lingshi/lang/zh_cn.json @@ -5,9 +5,11 @@ "block.lingshi.skillet": "平底锅", "block.lingshi.tea_tree": "茶树", "gui.lingshi.skillet_menu": "平底锅", + "item.lingshi.fried_egg": "煎鸡蛋", "item.lingshi.iron_knife": "铁菜刀", "item.lingshi.oil_bucket": "油桶", "item.lingshi.rice_of_ear": "稻穗", + "item.lingshi.spatula": "锅铲", "item.lingshi.tea_leaf": "茶叶", "lingshi.lingshi_tab": "灵食" } \ No newline at end of file diff --git a/src/generated/resources/assets/lingshi/models/item/fried_egg.json b/src/generated/resources/assets/lingshi/models/item/fried_egg.json new file mode 100644 index 0000000..b818411 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/fried_egg.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "lingshi:item/fried_egg" + } +} \ No newline at end of file diff --git a/src/generated/resources/assets/lingshi/models/item/spatula.json b/src/generated/resources/assets/lingshi/models/item/spatula.json new file mode 100644 index 0000000..c8d1ca6 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/spatula.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/handheld", + "textures": { + "layer0": "lingshi:item/spatula" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/decorations/chopping_board.json b/src/generated/resources/data/lingshi/advancement/recipes/decorations/chopping_board.json new file mode 100644 index 0000000..5e29683 --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/decorations/chopping_board.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": "minecraft:stick" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:chopping_board" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_iron_ingot" + ] + ], + "rewards": { + "recipes": [ + "lingshi:chopping_board" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/decorations/skillet.json b/src/generated/resources/data/lingshi/advancement/recipes/decorations/skillet.json new file mode 100644 index 0000000..d5e531e --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/decorations/skillet.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": "#minecraft:planks" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_iron_ingot" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/baked_potato.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/baked_potato.json new file mode 100644 index 0000000..9fe0b5c --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/baked_potato.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:baked_potato" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/baked_potato" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/baked_potato" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_beef.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_beef.json new file mode 100644 index 0000000..2fb7faa --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_beef.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_beef" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_beef" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_beef" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_chicken.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_chicken.json new file mode 100644 index 0000000..d57a8da --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_chicken.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_chicken" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_chicken" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_chicken" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_cod.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_cod.json new file mode 100644 index 0000000..49bc207 --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_cod.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_cod" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_cod" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_cod" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_mutton.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_mutton.json new file mode 100644 index 0000000..30be9dc --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_mutton.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_mutton" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_mutton" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_mutton" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_porkchop.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_porkchop.json new file mode 100644 index 0000000..7ea5203 --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_porkchop.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_porkchop" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_porkchop" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_porkchop" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_rabbit.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_rabbit.json new file mode 100644 index 0000000..1bb807d --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_rabbit.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_rabbit" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_rabbit" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_rabbit" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_salmon.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_salmon.json new file mode 100644 index 0000000..65a72df --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/cooked_salmon.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "minecraft:cooked_salmon" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/cooked_salmon" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/cooked_salmon" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/skillet/fried_egg.json b/src/generated/resources/data/lingshi/advancement/recipes/skillet/fried_egg.json new file mode 100644 index 0000000..9d95653 --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/skillet/fried_egg.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_skillet": { + "conditions": { + "items": [ + { + "items": "lingshi:fried_egg" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:skillet/fried_egg" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_skillet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:skillet/fried_egg" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/tools/iron_knife.json b/src/generated/resources/data/lingshi/advancement/recipes/tools/iron_knife.json new file mode 100644 index 0000000..1f42e33 --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/tools/iron_knife.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": "minecraft:iron_ingot" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:iron_knife" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_iron_ingot" + ] + ], + "rewards": { + "recipes": [ + "lingshi:iron_knife" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/tools/spatula.json b/src/generated/resources/data/lingshi/advancement/recipes/tools/spatula.json new file mode 100644 index 0000000..7b93daf --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/tools/spatula.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_iron_ingot": { + "conditions": { + "items": [ + { + "items": "minecraft:iron_ingot" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:spatula" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_iron_ingot" + ] + ], + "rewards": { + "recipes": [ + "lingshi:spatula" + ] + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/data_maps/fluid/cooking_food_fliud.json b/src/generated/resources/data/lingshi/data_maps/fluid/cooking_food_fliud.json new file mode 100644 index 0000000..bdfe519 --- /dev/null +++ b/src/generated/resources/data/lingshi/data_maps/fluid/cooking_food_fliud.json @@ -0,0 +1,12 @@ +{ + "values": { + "lingshi:oil_source": { + "burnt_time": 30, + "cooked_time": 8 + }, + "minecraft:water": { + "burnt_time": 30, + "cooked_time": 15 + } + } +} \ 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 new file mode 100644 index 0000000..efcf02e --- /dev/null +++ b/src/generated/resources/data/lingshi/data_maps/item/cooking_food_item.json @@ -0,0 +1,44 @@ +{ + "values": { + "lingshi:rice": { + "burnt_time": 20, + "cooked_time": 10 + }, + "minecraft:beef": { + "burnt_time": 20, + "cooked_time": 5 + }, + "minecraft:chicken": { + "burnt_time": 20, + "cooked_time": 5 + }, + "minecraft:cod": { + "burnt_time": 20, + "cooked_time": 5 + }, + "minecraft:egg": { + "burnt_time": 15, + "cooked_time": 3 + }, + "minecraft:mutton": { + "burnt_time": 20, + "cooked_time": 5 + }, + "minecraft:porkchop": { + "burnt_time": 20, + "cooked_time": 5 + }, + "minecraft:potato": { + "burnt_time": 25, + "cooked_time": 5 + }, + "minecraft:rabbit": { + "burnt_time": 20, + "cooked_time": 5 + }, + "minecraft:salmon": { + "burnt_time": 20, + "cooked_time": 5 + } + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/chopping_board.json b/src/generated/resources/data/lingshi/recipe/chopping_board.json new file mode 100644 index 0000000..0b78875 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/chopping_board.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "item": "minecraft:stick" + }, + "X": { + "tag": "minecraft:planks" + } + }, + "pattern": [ + "XX#", + "XX#" + ], + "result": { + "count": 1, + "id": "lingshi:chopping_board" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/iron_knife.json b/src/generated/resources/data/lingshi/recipe/iron_knife.json new file mode 100644 index 0000000..3a290f1 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/iron_knife.json @@ -0,0 +1,19 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "item": "minecraft:stick" + }, + "X": { + "item": "minecraft:iron_ingot" + } + }, + "pattern": [ + "#X" + ], + "result": { + "count": 1, + "id": "lingshi:iron_knife" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet.json b/src/generated/resources/data/lingshi/recipe/skillet.json new file mode 100644 index 0000000..95e1baf --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet.json @@ -0,0 +1,20 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "misc", + "key": { + "#": { + "tag": "minecraft:planks" + }, + "X": { + "tag": "minecraft:terracotta" + } + }, + "pattern": [ + "XX#", + "XX " + ], + "result": { + "count": 1, + "id": "lingshi:skillet" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/baked_potato.json b/src/generated/resources/data/lingshi/recipe/skillet/baked_potato.json new file mode 100644 index 0000000..85833f7 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/baked_potato.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:potato" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:baked_potato" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_beef.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_beef.json new file mode 100644 index 0000000..c6e79d7 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_beef.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:beef" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_beef" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_chicken.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_chicken.json new file mode 100644 index 0000000..2f0f86c --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_chicken.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:chicken" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_chicken" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_cod.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_cod.json new file mode 100644 index 0000000..2833a32 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_cod.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:cod" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_cod" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_mutton.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_mutton.json new file mode 100644 index 0000000..0fa2619 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_mutton.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:mutton" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_mutton" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_porkchop.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_porkchop.json new file mode 100644 index 0000000..feaa669 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_porkchop.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:porkchop" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_porkchop" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_rabbit.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_rabbit.json new file mode 100644 index 0000000..7d156f2 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_rabbit.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:rabbit" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_rabbit" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/cooked_salmon.json b/src/generated/resources/data/lingshi/recipe/skillet/cooked_salmon.json new file mode 100644 index 0000000..9142b33 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/cooked_salmon.json @@ -0,0 +1,14 @@ +{ + "type": "lingshi:skillet", + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:salmon" + } + ], + "label": "heat", + "result": { + "count": 1, + "id": "minecraft:cooked_salmon" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/skillet/fried_egg.json b/src/generated/resources/data/lingshi/recipe/skillet/fried_egg.json new file mode 100644 index 0000000..dd6a87d --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/skillet/fried_egg.json @@ -0,0 +1,18 @@ +{ + "type": "lingshi:skillet", + "fluid": { + "amount": 100, + "id": "lingshi:oil_source" + }, + "group": "Skillet", + "ingredients": [ + { + "item": "minecraft:egg" + } + ], + "label": "pan_fry", + "result": { + "count": 1, + "id": "lingshi:fried_egg" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/spatula.json b/src/generated/resources/data/lingshi/recipe/spatula.json new file mode 100644 index 0000000..b0d5cb2 --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/spatula.json @@ -0,0 +1,21 @@ +{ + "type": "minecraft:crafting_shaped", + "category": "equipment", + "key": { + "#": { + "item": "minecraft:stick" + }, + "X": { + "item": "minecraft:iron_ingot" + } + }, + "pattern": [ + " X", + " X ", + "# " + ], + "result": { + "count": 1, + "id": "lingshi:spatula" + } +} \ No newline at end of file diff --git a/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java b/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java index eb2d975..0a16e8c 100644 --- a/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java +++ b/src/main/java/mczme/lingshi/client/BlockEntityRenderer/SkilletBER.java @@ -2,6 +2,7 @@ import com.mojang.blaze3d.vertex.PoseStack; import com.mojang.math.Axis; +import mczme.lingshi.client.model.ModelMap; import mczme.lingshi.common.block.ChoppingBoardBlock; import mczme.lingshi.common.block.entity.SkilletBlockEntity; import net.minecraft.client.Minecraft; @@ -10,31 +11,62 @@ import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider; import net.minecraft.core.Direction; import net.minecraft.world.item.ItemDisplayContext; +import net.minecraft.world.level.material.Fluids; +import net.neoforged.neoforge.fluids.FluidStack; import net.neoforged.neoforge.items.ItemStackHandler; +import java.util.Random; + +import static mczme.lingshi.client.util.RenderUtil.fluidRender; + public class SkilletBER implements BlockEntityRenderer { - public SkilletBER(BlockEntityRendererProvider.Context pContext){ + public SkilletBER(BlockEntityRendererProvider.Context pContext) { } @Override public void render(SkilletBlockEntity pBlockEntity, float pPartialTick, PoseStack pPoseStack, MultiBufferSource pBufferSource, int pPackedLight, int pPackedOverlay) { ItemStackHandler itemStack = pBlockEntity.getItemStacks(); + FluidStack fluidStack = pBlockEntity.getFluid(); Direction direction = pBlockEntity.getBlockState().getValue(ChoppingBoardBlock.FACING); + double[] X = {0.5, 0.3, 0.6, 0.3, 0.6}; + double[] Z = {0.5, 0.3, 0.3, 0.6, 0.6}; + double[] Y = {0.13, 0.125, 0.123, 0.125, 0.122}; + + if (!pBlockEntity.isEmpty()) { + if (!fluidStack.isEmpty()) { + if(fluidStack.getFluid().isSame(Fluids.WATER)){ + fluidRender(fluidStack.getFluid(), pPoseStack, pBufferSource, pBlockEntity.getLevel(), pBlockEntity.getBlockPos(), pPackedLight, 2.5f); + }else { + fluidRender(fluidStack.getFluid(), pPoseStack, pBufferSource, pBlockEntity.getLevel(), pBlockEntity.getBlockPos(), pPackedLight, 1.5f); + } + } - if(!pBlockEntity.isEmpty()){ - for (int i = 0; i 123456; + case 2 -> 886549; + default -> 0; + }; + rand.setSeed(seed); + return seed == 0 ? 0 : rand.nextFloat() * 180; + } + } diff --git a/src/main/java/mczme/lingshi/client/model/ModelMap.java b/src/main/java/mczme/lingshi/client/model/ModelMap.java new file mode 100644 index 0000000..47859bb --- /dev/null +++ b/src/main/java/mczme/lingshi/client/model/ModelMap.java @@ -0,0 +1,28 @@ +package mczme.lingshi.client.model; + +import mczme.lingshi.common.registry.ModItems; +import net.minecraft.world.item.Item; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.Items; + +import java.util.HashMap; +import java.util.Map; + +public class ModelMap { + private static final Map map = new HashMap<>(); + + public ModelMap(){ + } + + public static void init() { + map.put(Items.EGG, ModItems.FRIED_EGG.get()); + } + + public static ItemStack get(ItemStack stack) { + Item item = map.get(stack.getItem()); + if (item != null) { + return new ItemStack(item, stack.getCount()); + } + return stack; + } +} diff --git a/src/main/java/mczme/lingshi/client/recipebook/SkilletRecipeBookComponent.java b/src/main/java/mczme/lingshi/client/recipebook/SkilletRecipeBookComponent.java index e8df3c9..be17d1e 100644 --- a/src/main/java/mczme/lingshi/client/recipebook/SkilletRecipeBookComponent.java +++ b/src/main/java/mczme/lingshi/client/recipebook/SkilletRecipeBookComponent.java @@ -1,8 +1,11 @@ package mczme.lingshi.client.recipebook; import mczme.lingshi.common.recipe.SkilletRecipe; +import mczme.lingshi.lingshi; +import net.minecraft.client.gui.components.WidgetSprites; import net.minecraft.client.gui.screens.recipebook.RecipeBookComponent; import net.minecraft.core.NonNullList; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.inventory.Slot; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.Ingredient; @@ -13,6 +16,13 @@ public class SkilletRecipeBookComponent extends RecipeBookComponent { + private static final WidgetSprites FILTER_SPRITES = new WidgetSprites( + ResourceLocation.fromNamespaceAndPath(lingshi.MODID,"recipe_book/skillet_filter_enabled"), + ResourceLocation.fromNamespaceAndPath(lingshi.MODID,"recipe_book/skillet_filter_disabled"), + ResourceLocation.fromNamespaceAndPath(lingshi.MODID,"recipe_book/skillet_filter_enabled_highlighted"), + ResourceLocation.fromNamespaceAndPath(lingshi.MODID,"recipe_book/skillet_filter_disabled_highlighted") + ); + @Override public void setupGhostRecipe(RecipeHolder pRecipe, List pSlots) { SkilletRecipe skilletRecipe = (SkilletRecipe) pRecipe.value(); @@ -39,4 +49,9 @@ public void setupGhostRecipe(RecipeHolder pRecipe, List pSlots) { } } + @Override + protected void initFilterButtonTextures() { + this.filterButton.initTextureValues(FILTER_SPRITES); + } + } diff --git a/src/main/java/mczme/lingshi/client/screen/CookingHud.java b/src/main/java/mczme/lingshi/client/screen/CookingHud.java index ad4c575..be803c3 100644 --- a/src/main/java/mczme/lingshi/client/screen/CookingHud.java +++ b/src/main/java/mczme/lingshi/client/screen/CookingHud.java @@ -103,7 +103,7 @@ private boolean getHitResult(BlockEntityType pType) { private void drawItemProgress(GuiGraphics pGuiGraphics, CookingFoodData cookingFoodData, int i, int j) { int pHeight = 8; - int progress = Math.min(cookingTime[i], 600); + int progress = Math.min(cookingTime[i], 580); int index = i + j; pGuiGraphics.blit(HUD_Sprite, X, Y + index * 18 + 7, cookingFoodData.cookedTime() * 2, pHeight, 0, 0, cookingFoodData.cookedTime() * 2 + 2, pHeight, 64, 64); pGuiGraphics.blit(HUD_Sprite, X + cookingFoodData.cookedTime() * 2, Y + index * 18 + 7, (cookingFoodData.burntTime() - cookingFoodData.cookedTime()) * 2, pHeight, 2, 8, (cookingFoodData.burntTime() - cookingFoodData.cookedTime()) * 2, pHeight, 64, 64); @@ -113,7 +113,7 @@ private void drawItemProgress(GuiGraphics pGuiGraphics, CookingFoodData cookingF private void drawFluidProgress(GuiGraphics pGuiGraphics, CookingFoodData cookingFoodData, int j) { int pHeight = 8; - int progress = Math.min(cookingTime[5], 600); + int progress = Math.min(cookingTime[5], 580); ItemStack bucket = ModFluids.MOD_FLUID_TYPE.get().getBucket(fluidStack); if (!bucket.isEmpty()) { pGuiGraphics.renderItem(bucket, X - 18, Y + j * 18); diff --git a/src/main/java/mczme/lingshi/client/util/RenderUtil.java b/src/main/java/mczme/lingshi/client/util/RenderUtil.java new file mode 100644 index 0000000..e350c80 --- /dev/null +++ b/src/main/java/mczme/lingshi/client/util/RenderUtil.java @@ -0,0 +1,44 @@ +package mczme.lingshi.client.util; + +import com.mojang.blaze3d.vertex.PoseStack; +import com.mojang.blaze3d.vertex.VertexConsumer; +import net.minecraft.client.renderer.BiomeColors; +import net.minecraft.client.renderer.MultiBufferSource; +import net.minecraft.client.renderer.RenderType; +import net.minecraft.client.renderer.texture.TextureAtlasSprite; +import net.minecraft.core.BlockPos; +import net.minecraft.util.FastColor; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.material.Fluid; +import net.minecraft.world.level.material.Fluids; +import org.joml.Matrix4f; + +public class RenderUtil { + + public static void fluidRender(Fluid fluid, PoseStack pPoseStack, MultiBufferSource pBufferSource, Level pLevel, BlockPos pPos,int pPackedLight,float height){ + pPoseStack.pushPose(); + pPoseStack.scale(13/16F, 13/16F, 13/16F); + pPoseStack.translate(2/16F, 0F, 2/16F); + TextureAtlasSprite[] atextureatlassprite = net.neoforged.neoforge.client.textures.FluidSpriteCache.getFluidSprites(pLevel, pPos, fluid.defaultFluidState()); + TextureAtlasSprite still = atextureatlassprite[0]; + int colour = fluid.isSame(Fluids.WATER)?BiomeColors.getAverageWaterColor(pLevel, pPos) : 0xA1EAD909; + float red = (float) FastColor.ARGB32.red(colour) / 255.0F; + float green = (float) FastColor.ARGB32.green(colour) / 255.0F; + float blue = (float) FastColor.ARGB32.blue(colour) / 255.0F; + float offset = height /16; + float uScale = still.getU1() - still.getU0(); + float vScale = still.getV1() - still.getV0(); + float u0 = still.getU0() + uScale * (float)0; + float u1 = still.getU0() + uScale; + float v0 = still.getV0() + vScale * (float)0; + float v1 = still.getV0() + vScale; + RenderType type = RenderType.translucentMovingBlock(); + VertexConsumer consumer = pBufferSource.getBuffer(type); + Matrix4f matrix = pPoseStack.last().pose(); + consumer.addVertex(matrix, (float)0, offset, (float)0).setColor(red, green, blue, 1.0F).setUv(u0, v0).setLight(pPackedLight).setNormal(0.0F, 1.0F, 0.0F); + consumer.addVertex(matrix, (float)0, offset, (float)1).setColor(red, green, blue, 1.0F).setUv(u0, v1).setLight(pPackedLight).setNormal(0.0F, 1.0F, 0.0F); + consumer.addVertex(matrix, (float)1, offset, (float)1).setColor(red, green, blue, 1.0F).setUv(u1, v1).setLight(pPackedLight).setNormal(0.0F, 1.0F, 0.0F); + consumer.addVertex(matrix, (float)1, offset, (float)0).setColor(red, green, blue, 1.0F).setUv(u1, v0).setLight(pPackedLight).setNormal(0.0F, 1.0F, 0.0F); + pPoseStack.popPose(); + } +} diff --git a/src/main/java/mczme/lingshi/common/block/SkilletBlock.java b/src/main/java/mczme/lingshi/common/block/SkilletBlock.java index 5aacb33..5bca7a8 100644 --- a/src/main/java/mczme/lingshi/common/block/SkilletBlock.java +++ b/src/main/java/mczme/lingshi/common/block/SkilletBlock.java @@ -67,7 +67,11 @@ public ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Leve return ItemInteractionResult.SUCCESS; } } else if (pStack.is(ModItems.SPATULA.get())) { - if (!blockEntity.isEmpty()) { + if(blockEntity.size()==0){ + blockEntity.setFluid(FluidStack.EMPTY); + blockEntity.setChanged(); + return ItemInteractionResult.SUCCESS; + }else if (!blockEntity.isEmpty()) { blockEntity.stirFryCount++; blockEntity.setChanged(); return ItemInteractionResult.SUCCESS; @@ -75,10 +79,12 @@ public ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Leve } else if (!blockEntity.isFull() && !pStack.isEmpty()) { if (pStack.is(Items.WATER_BUCKET)) { blockEntity.setFluid(new FluidStack(Fluids.WATER, 250)); + blockEntity.getCookingTime()[5] = 0; blockEntity.setChanged(); return ItemInteractionResult.SUCCESS; } else if (pStack.is(ModItems.OIL_BUCKET.get())) { blockEntity.setFluid(new FluidStack(ModFluids.OIL_SOURCE.get(), 100)); + blockEntity.getCookingTime()[5] = 0; blockEntity.setChanged(); return ItemInteractionResult.SUCCESS; } diff --git a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java index 72ddba1..effc3b3 100644 --- a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java @@ -27,10 +27,17 @@ protected CookingFoodDataGen(PackOutput packOutput, CompletableFuture pReg protected void buildRecipes(RecipeOutput output) { new ChoppingBoardRecipeDatagen(output); new SkilletRecipeDatagen(output); + new CraftingRecipeDataGen(output); } public static Criterion has(MinMaxBounds.Ints pCount, ItemLike pItem) { 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 ff2c3cd..63451b5 100644 --- a/src/main/java/mczme/lingshi/common/data/recipe/SkilletRecipeDatagen.java +++ b/src/main/java/mczme/lingshi/common/data/recipe/SkilletRecipeDatagen.java @@ -2,35 +2,56 @@ import mczme.lingshi.client.recipebook.CookingFoodRecipeLabel; import mczme.lingshi.common.data.builder.SkilletRecipeBuilder; -import mczme.lingshi.common.recipe.SkilletRecipe; +import mczme.lingshi.common.registry.ModFluids; import mczme.lingshi.common.registry.ModItems; +import mczme.lingshi.lingshi; import net.minecraft.data.recipes.RecipeOutput; +import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.item.crafting.Ingredient; -import net.minecraft.world.level.material.Fluids; import net.neoforged.neoforge.fluids.FluidStack; import java.util.List; +import static mczme.lingshi.common.data.recipe.Recipes.has; + public class SkilletRecipeDatagen { public SkilletRecipeDatagen(RecipeOutput output) { buildRecipes(output); } protected void buildRecipes(RecipeOutput output) { - build(List.of(Ingredient.of(ModItems.RICE.get())), null, new ItemStack(Items.APPLE.asItem())) - .setLabel(CookingFoodRecipeLabel.PAN_FRY) - .setContainer(new SkilletRecipe.SkilletCookingContainer(new ItemStack(Items.BOWL),0)).save(output,"rice_apple"); - build(List.of(Ingredient.of(Items.GOLD_BLOCK),Ingredient.of(Items.IRON_BLOCK)), null, new ItemStack(Items.DIAMOND.asItem())) - .setLabel(CookingFoodRecipeLabel.BOIL).save(output,"test01"); - build(List.of(Ingredient.of(Items.DIAMOND_BLOCK),Ingredient.of(Items.MILK_BUCKET)), null, new ItemStack(Items.WHEAT.asItem())) - .setLabel(CookingFoodRecipeLabel.HEAT).save(output,"test02"); - build(List.of(Ingredient.of(Items.APPLE),Ingredient.of(Items.GOLD_BLOCK)), new FluidStack(Fluids.WATER,250), new ItemStack(Items.GOLDEN_APPLE)) - .setLabel(CookingFoodRecipeLabel.PAN_FRY).setContainer(new SkilletRecipe.SkilletCookingContainer(new ItemStack(Items.BOWL),3)).save(output,"test03"); +// 加热 + build(List.of(Ingredient.of(Items.POTATO)),null,new ItemStack(Items.BAKED_POTATO)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("baked_potato")); + build(List.of(Ingredient.of(Items.BEEF)),null,new ItemStack(Items.COOKED_BEEF)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_beef")); + build(List.of(Ingredient.of(Items.PORKCHOP)),null,new ItemStack(Items.COOKED_PORKCHOP)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_porkchop")); + build(List.of(Ingredient.of(Items.MUTTON)),null,new ItemStack(Items.COOKED_MUTTON)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_mutton")); + build(List.of(Ingredient.of(Items.CHICKEN)),null,new ItemStack(Items.COOKED_CHICKEN)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_chicken")); + build(List.of(Ingredient.of(Items.RABBIT)),null,new ItemStack(Items.COOKED_RABBIT)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_rabbit")); + build(List.of(Ingredient.of(Items.COD)),null,new ItemStack(Items.COOKED_COD)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_cod")); + build(List.of(Ingredient.of(Items.SALMON)),null,new ItemStack(Items.COOKED_SALMON)) + .setLabel(CookingFoodRecipeLabel.HEAT).save(output,create("cooked_salmon")); + // 煎 + build(List.of(Ingredient.of(Items.EGG)),new FluidStack(ModFluids.OIL_SOURCE.get(),100),new ItemStack(ModItems.FRIED_EGG.get())) + .setLabel(CookingFoodRecipeLabel.PAN_FRY).save(output,create("fried_egg")); + // 炒 + + // 煮 } private SkilletRecipeBuilder build(List items, FluidStack fluid, ItemStack result){ - return new SkilletRecipeBuilder(items, fluid, result).group("Skillet"); + return new SkilletRecipeBuilder(items, fluid, result).unlockedBy("has_skillet",has(result.getItem())).group("Skillet"); + } + + private ResourceLocation create(String s){ + return ResourceLocation.fromNamespaceAndPath(lingshi.MODID,s); } } diff --git a/src/main/java/mczme/lingshi/common/event/Setup.java b/src/main/java/mczme/lingshi/common/event/Setup.java new file mode 100644 index 0000000..5b8eec3 --- /dev/null +++ b/src/main/java/mczme/lingshi/common/event/Setup.java @@ -0,0 +1,17 @@ +package mczme.lingshi.common.event; + +import mczme.lingshi.client.model.ModelMap; +import mczme.lingshi.lingshi; +import net.neoforged.api.distmarker.Dist; +import net.neoforged.bus.api.SubscribeEvent; +import net.neoforged.fml.common.EventBusSubscriber; +import net.neoforged.fml.event.lifecycle.FMLClientSetupEvent; + +@EventBusSubscriber(modid = lingshi.MODID, bus = EventBusSubscriber.Bus.MOD,value = Dist.CLIENT) +public class Setup { + @SubscribeEvent + public static void fMLClientSetupEvent(FMLClientSetupEvent event) + { + ModelMap.init(); + } +} diff --git a/src/main/java/mczme/lingshi/common/registry/ModItems.java b/src/main/java/mczme/lingshi/common/registry/ModItems.java index 345c0c1..43fa205 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModItems.java +++ b/src/main/java/mczme/lingshi/common/registry/ModItems.java @@ -3,6 +3,7 @@ import mczme.lingshi.common.item.KnifeItem; import mczme.lingshi.common.item.SpatulaItem; import mczme.lingshi.lingshi; +import net.minecraft.world.food.FoodProperties; import net.minecraft.world.item.*; import net.neoforged.bus.api.IEventBus; import net.neoforged.neoforge.registries.DeferredRegister; @@ -30,7 +31,7 @@ public class ModItems { public static final Supplier OIL_BUCKET = registerWithCreateTab("oil_bucket",()->new BucketItem(ModFluids.OIL_SOURCE.get(),new Item.Properties().craftRemainder(Items.BUCKET).stacksTo(1))); public static final Supplier STRANGE_FOOD = registerWithCreateTab("strange_food",()->new Item(new Item.Properties())); - + public static final Supplier FRIED_EGG = registerWithCreateTab("fried_egg",()->new Item(new Item.Properties().food(new FoodProperties.Builder().nutrition(4).saturationModifier(3.2f).build()))); private static Supplier registerWithCreateTab(String item_name, Supplier itemSupplier) { Supplier item = ITEMS.register(item_name, itemSupplier); ITEMS_LIST.add(item); diff --git a/src/main/resources/assets/lingshi/textures/gui/cooking_hud.png b/src/main/resources/assets/lingshi/textures/gui/cooking_hud.png index 9f78b8c29a8d19ca27601b04a8424545a2c17087..008ec14898b104bd873535800ccfe989bd6f8698 100644 GIT binary patch delta 701 zcmV;u0z&=P1=R(RB!8SqL_t(|ob8%TYZFlzh0lbZJK7=kTNb?h1i0-6*V2e>_ z84|i^=nv4~(q%!Rxap#F9~in3#417pf?%?;U8FV?0%F=KL2N^kY1G$6GULQfB!bQ* zbKhr?$=uAqIp==8T%zC?1i4VG4**0Ymw!d+`uCgW^ZC4JO@FSUX&Q80C!c5`qTv8U z3lNR92x^)pSc<#ox()z}Vr!FY8|ZaDPl4W5+B!fn&EF`7L~C-Du}3$d>pD*X4nVX3 z(QqALYm;jm;5wj-^mTxB9VFM@eMYI-yOs*0pSEZZ+f5pA~S>ZuTpjDLWR(WHPHQUYqo+772@66ky< zL?dDB?R-GJUPtp_A6KTXj(iA?Q^4$f00^ooHaE+NM#89Um9c-&K&@88^R+d+dii4H zYX-ml#@_2DZNmTnRJO_hfLg7FTrP)F@$JZ)M_)Z`8~)~fGL@!SB#L6GXg$+vweaS3 z_fM5hfq#t}{y{$^Q)xOIi=j{`9O>i1#ya~%(JO{?9>sF#Mn z0ssrMVLCN-96O)-&D$}9@RE4|@Gs1U=|s?nN;Y*DkDqq_XwGZq0l@!p?<)Y{$us%P jGYrEp48t%CBQHMz+le)2wn^$!00000NkvXXu0mjf59>rq delta 702 zcmV;v0zv)N1=aQkmgVDAbOMffh|VO zF(mZR&_6(fM~?-C;-!budtm8B5UU6Y2!hGU_K?~T2&k!5La_}=w^3gYN!E3fN<6qj zcHZA1VTK93&of^SLj-<9Pzzyx03af@^b66^@9l}t<#MuXa(|R~JPuvg$s@ZE*{}h! z3y_U@2*%@a$)z}puIm6Ggr!fdYoI&%yal@7%H{yk6Mv%+kX@6bj6J#uUDtUFumQ3Q zkPYVmOP^ZT0Ox=X%I5&{Jz%4#$*##!_&uNt8z8#?*>Dc9^r>|Xa1Q98d=4<*11cAM zvTJgb2NN-V4}Sok0c-&00OfN403e#FQZ!Rl%>V#^h-Ru(dA|WVY~W}47*M_=hWMRp z@BjcEHgFQVvTKpZ7Z1DO-tzCY6Uh`sLSYn&1#?WR)xw+C zoj+At$A6A0_7z}~NT%p)B!YZC-#6PnEnps$qi({$Loks{(Zx%b@os(n$fZ8&!jGgk zvs2fu+fR5JG|t)T{xgg7a;~Y4+QNcCSg- zEPnw23$sBwHFg}^U;Y$70CJOf01ykaK|100pf~by7muH|l@bpC-cLK<002*({Z%~N kD4t;$hG7_nVHkD!1;X+pv#n3F&;S4c07*qoM6N<$f*<=xMF0Q* diff --git a/src/main/resources/assets/lingshi/textures/gui/sprites/recipe_book/skillet_filter_disabled.png b/src/main/resources/assets/lingshi/textures/gui/sprites/recipe_book/skillet_filter_disabled.png new file mode 100644 index 0000000000000000000000000000000000000000..c2db6eefaeb6d3389638282a4ec512250d3291fc GIT binary patch literal 400 zcmV;B0dM|^P)W8g zjlV(wjI9aI*#(JIhT))(CL#bFWKVG7NsQg7KctFIRc@=w!>tL{_4_26#&FOlk;*I} z03j7JAE9?Lw{=Oo=du=j;qKAJ$Vbt)ci2lG11J&ZUmZTtc_(Z4T-x1dVuz>X^5>rs uW(&RuK)|vr`LDj9@9NJW48xGX%GVn_9J8G>GknAV0000{-@bY0Jynd`vwb!bc{=A#&zd_u3samNbPaob}x(46Yw?a1# z*$Av=F)%Q6$eQ2IY&Nj*{`BEJJ0}+d1B0DU%x!(E4yza}#-Vu@4g9#2b9+w$!?EoQ z3=Hh-?4LfoH?Z+WHj9CQfd$PhWG}UTHno+5v4jBY#O?BxYxFk`m zb_gPA0&OXXI0Up@E(Js0ba&kQ@!fEx%iakJ%JJE&2;k_}D}?*(4}^S8(eg#hPoL-E zM9aUoFK({R)8fB5(efR;^9^Bbb;YqejJS-W)re~mA`>D5AVg-wOfGFDNgx38*>pae zGNQokC+qg0!dPyT>W2Bdl}I@rhue)^SF3TROOz}NfU0!e!&BWb<8dgFGJtyXz}0H1 z7O-5>Ut&@JWyg8M-8BG7lHzfw8|I<~KwK=e2Nhb4(iZifz0qVSd_4^(YAbNp=~iP8 z0AsOS)?D6b;=M;f%lLb8lj6-~EDpy_ufEBgs7e{-@bY0Jynd`vwb!bc{=A#&zd_u3samNaxXfZ;VCaxF zzn$4^VB`Ji!+Um4E(Qh$JD-@_`c@rQG3drY^y4w>$EBRxdlDFqZD(L$U}tCl^x?gM zjW@Dc3=9k`$Qn3qHT_Vl!!+y1rR+OTzp^p?x%TL5M`}!ktg5+dC<6lnnpx<^;d0lV zr(f?p`52J8UJd5u3LgfB$G6eUVqjokT)*wsz-KaCfXc?P+`RLC&-U5WG7bQd0EsU9 S+<6QD0000;nP)iVT-E)@2<#00bXCA1`MEg0}PX_Z!&kDv~&?;8t?>g;e5$ z&(HM>zCCr$mUyJS%-G1lz+l6J%Q`=cSY19nj%8!pnzh4GKW=}!^s$yTKcDx%*O*n` zb<^u-x;j0% zg9m4%P)h%71)7a@eEwh~+dTWV>DTHIXPbZBXb8bas~sIBGgZ4NCBL5o8~ z5VVMpRPPZ;&tIkYHrRXgl>UG^%Y}2l-|zXJ?}0yG;|6`S_6hkEOZkjWWw&V8YlxRyq>%Kc7cqhrIy0N7YMIc)9LI$s zN0$!*Kn{{WCT0nQ=RI;H8b*#MQL2lKEdkJS-o2sHwe3y@80}pn;%fjjf(aT{6T`Yd z+RwD>H4aV>*BLJTxE9gqeo9w#qRsd*NO{5H< zs^$Kxy8Yg_b)^*}uXh|5ik#d$315h2F0D6qv)&p2MzDe$Ptph`Fsuu7XxSH_?~FTV zSHc7>9GmsM0_}Q@RwoWt6B!G5Qql literal 0 HcmV?d00001