From 7be04c00d4d3741d3f1a12a15bcb476ee66d688a Mon Sep 17 00:00:00 2001 From: MCZME <13183052+mczme@user.noreply.gitee.com> Date: Wed, 28 Aug 2024 02:24:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E7=B1=B3=E9=A5=AD?= =?UTF-8?q?=E6=9D=90=E8=B4=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 | 3 ++- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 8 ++++---- .../assets/lingshi/models/item/cooked_rice.json | 6 ++++++ .../lingshi/recipe/cooking_pot/cooked_rice.json | 2 +- .../lingshi/recipe/cooking_pot/cooked_rice_1.json | 2 +- .../lingshi/recipe/cooking_pot/cooked_rice_2.json | 2 +- .../mczme/lingshi/client/screen/CookingHud.java | 6 +++--- .../block/entity/CookingPotBlockEntity.java | 1 - .../mczme/lingshi/common/data/ItemModels.java | 1 + .../data/recipe/CookingPotRecipeDataGen.java | 6 +++--- .../java/mczme/lingshi/common/item/PotLid.java | 10 +++++++--- .../assets/lingshi/textures/item/cooked_rice.png | Bin 0 -> 390 bytes 12 files changed, 29 insertions(+), 18 deletions(-) create mode 100644 src/generated/resources/assets/lingshi/models/item/cooked_rice.json create mode 100644 src/main/resources/assets/lingshi/textures/item/cooked_rice.png diff --git a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 index 493ec00..545df70 100644 --- a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 +++ b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 @@ -1,5 +1,6 @@ -// 1.21 2024-08-27T02:55:56.0305846 Item Models: lingshi +// 1.21 2024-08-28T02:16:16.4080139 Item Models: lingshi bad0cb5e093fa42331c2d4a1157d1a7b5b3fc588 assets/lingshi/models/item/chopping_board.json +7bc27021669767547c0b0bd606195e5f80cea272 assets/lingshi/models/item/cooked_rice.json 8106af92df770f5e2062db0b6aaed967fe386d87 assets/lingshi/models/item/cooking_pot.json 014b17c43a62c41d623a0d944e434cf1ac3986be assets/lingshi/models/item/fried_egg.json 249957a6811e300efca306db358e468855851d73 assets/lingshi/models/item/iron_knife.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index 87417f4..ffd656b 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,4 +1,4 @@ -// 1.21 2024-08-27T06:08:36.0532515 Recipes +// 1.21 2024-08-28T02:16:16.4100096 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 @@ -17,9 +17,9 @@ ee50d7e3c59e644ce93e46945ff090c3c68fda04 data/lingshi/advancement/recipes/skille e511f76246f906a279fc1ec531922d8f70dfb68c data/lingshi/advancement/recipes/tools/spatula.json bec1047337843fdd073fe87393c3b500ae11a1de data/lingshi/recipe/chopping_board.json 3e41620c4ec5b19f87046dad7fe5c7ed6ede21c2 data/lingshi/recipe/chopping_board/rice.json -34ff78a571b7d344a2b31e18de2771cc505ab562 data/lingshi/recipe/cooking_pot/cooked_rice.json -5b0d88672d868c5aff2928bd701f603643ac0dc0 data/lingshi/recipe/cooking_pot/cooked_rice_1.json -e96b40d81c45dec0c25d57ddc8c8938c7196ec94 data/lingshi/recipe/cooking_pot/cooked_rice_2.json +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 e6daac4cca245fc9e220e2fcb1f2b27e410ba503 data/lingshi/recipe/iron_knife.json a0c7fd85028ea7997689d7bc093b9d025c522ea6 data/lingshi/recipe/skillet.json e2328874e467cf5efdb65d0fedeac1cfe1677e98 data/lingshi/recipe/skillet/baked_potato.json diff --git a/src/generated/resources/assets/lingshi/models/item/cooked_rice.json b/src/generated/resources/assets/lingshi/models/item/cooked_rice.json new file mode 100644 index 0000000..b6a8975 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/cooked_rice.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "lingshi:item/cooked_rice" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice.json b/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice.json index cd5b65e..7de4679 100644 --- a/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice.json +++ b/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice.json @@ -11,7 +11,7 @@ "amount": 1000, "id": "minecraft:water" }, - "group": "", + "group": "rice", "ingredients": [ { "item": "lingshi:rice" diff --git a/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_1.json b/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_1.json index 344440a..003ae50 100644 --- a/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_1.json +++ b/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_1.json @@ -11,7 +11,7 @@ "amount": 1000, "id": "minecraft:water" }, - "group": "", + "group": "rice", "ingredients": [ { "item": "lingshi:rice" diff --git a/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_2.json b/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_2.json index 9ffca18..0842a31 100644 --- a/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_2.json +++ b/src/generated/resources/data/lingshi/recipe/cooking_pot/cooked_rice_2.json @@ -11,7 +11,7 @@ "amount": 1000, "id": "minecraft:water" }, - "group": "", + "group": "rice", "ingredients": [ { "item": "lingshi:rice" diff --git a/src/main/java/mczme/lingshi/client/screen/CookingHud.java b/src/main/java/mczme/lingshi/client/screen/CookingHud.java index 0f875df..0088d6a 100644 --- a/src/main/java/mczme/lingshi/client/screen/CookingHud.java +++ b/src/main/java/mczme/lingshi/client/screen/CookingHud.java @@ -81,11 +81,11 @@ public void render(@NotNull GuiGraphics pGuiGraphics, @NotNull DeltaTracker pDel int j = 0; if (!result.isEmpty()||!itemStackHandler.getStackInSlot(7).isEmpty()) { if(!result.isEmpty()){ - pGuiGraphics.renderItem(result, X+18, Y); + pGuiGraphics.renderItem(result, X+12, Y); } else if (!itemStackHandler.getStackInSlot(7).isEmpty()) { - pGuiGraphics.renderItem(itemStackHandler.getStackInSlot(7), X + 18, Y); + pGuiGraphics.renderItem(itemStackHandler.getStackInSlot(7), X + 12, Y); } - pGuiGraphics.drawCenteredString(Minecraft.getInstance().font, String.valueOf(itemStackHandler.getStackInSlot(7).getCount()), X + 42, Y + 6, 0xffffff); + pGuiGraphics.drawCenteredString(Minecraft.getInstance().font, String.valueOf(itemStackHandler.getStackInSlot(7).getCount()), X + 36, Y + 6, 0xffffff); pGuiGraphics.blit(HUD_Sprite, X-18, Y , 16, 16, 16, 36,16,16, 64, 64); pGuiGraphics.drawCenteredString(Minecraft.getInstance().font, String.valueOf(Count/20), X + 6, Y + 6, 0xffffff); if (!container.isEmpty()) { diff --git a/src/main/java/mczme/lingshi/common/block/entity/CookingPotBlockEntity.java b/src/main/java/mczme/lingshi/common/block/entity/CookingPotBlockEntity.java index 9a444c6..a39c25e 100644 --- a/src/main/java/mczme/lingshi/common/block/entity/CookingPotBlockEntity.java +++ b/src/main/java/mczme/lingshi/common/block/entity/CookingPotBlockEntity.java @@ -337,5 +337,4 @@ public static void serverTick(Level pLevel, BlockPos pPo blockEntity.setChanged(); } } - } diff --git a/src/main/java/mczme/lingshi/common/data/ItemModels.java b/src/main/java/mczme/lingshi/common/data/ItemModels.java index be94c9d..5cf00b2 100644 --- a/src/main/java/mczme/lingshi/common/data/ItemModels.java +++ b/src/main/java/mczme/lingshi/common/data/ItemModels.java @@ -17,6 +17,7 @@ protected void registerModels() { basicItem(ModItems.RICE_OF_EAR.get()); basicItem(ModItems.RICE_SEEDLING.get()); basicItem(ModItems.FRIED_EGG.get()); + basicItem(ModItems.COOKED_RICE.get()); basicItem(ModItems.OIL_BUCKET.get()); diff --git a/src/main/java/mczme/lingshi/common/data/recipe/CookingPotRecipeDataGen.java b/src/main/java/mczme/lingshi/common/data/recipe/CookingPotRecipeDataGen.java index e4e9dca..6d456c0 100644 --- a/src/main/java/mczme/lingshi/common/data/recipe/CookingPotRecipeDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/recipe/CookingPotRecipeDataGen.java @@ -24,15 +24,15 @@ public CookingPotRecipeDataGen(RecipeOutput output) { protected void buildRecipes(RecipeOutput output) { build(List.of(Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get())),new FluidStack(Fluids.WATER,1000),new ItemStack(ModItems.COOKED_RICE.get(),8),CookingFoodRecipeLabel.BOIL) - .unlockedBy("has_rice", has(ModItems.RICE.get())) + .unlockedBy("has_rice", has(ModItems.RICE.get())).group("rice") .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),0)) .save(output,create("cooked_rice")); build(List.of(Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get())),new FluidStack(Fluids.WATER,1000),new ItemStack(ModItems.COOKED_RICE.get(),10),CookingFoodRecipeLabel.BOIL) - .unlockedBy("has_rice", has(ModItems.RICE.get())) + .unlockedBy("has_rice", has(ModItems.RICE.get())).group("rice") .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),0)) .save(output,create("cooked_rice_1")); build(List.of(Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get())),new FluidStack(Fluids.WATER,1000),new ItemStack(ModItems.COOKED_RICE.get(),12),CookingFoodRecipeLabel.BOIL) - .unlockedBy("has_rice", has(ModItems.RICE.get())) + .unlockedBy("has_rice", has(ModItems.RICE.get())).group("rice") .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),0)) .save(output,create("cooked_rice_2")); diff --git a/src/main/java/mczme/lingshi/common/item/PotLid.java b/src/main/java/mczme/lingshi/common/item/PotLid.java index 3364ef1..bf9e0cf 100644 --- a/src/main/java/mczme/lingshi/common/item/PotLid.java +++ b/src/main/java/mczme/lingshi/common/item/PotLid.java @@ -1,5 +1,6 @@ package mczme.lingshi.common.item; +import mczme.lingshi.common.registry.ModBlocks; import net.minecraft.world.InteractionResult; import net.minecraft.world.item.Item; import net.minecraft.world.item.context.UseOnContext; @@ -13,10 +14,13 @@ public PotLid(Properties properties) { @Override public InteractionResult useOn(UseOnContext pContext) { - if(!pContext.getLevel().getBlockState(pContext.getClickedPos()).getValue(COVER)) { - pContext.getLevel().setBlockAndUpdate(pContext.getClickedPos(), pContext.getLevel().getBlockState(pContext.getClickedPos()).setValue(COVER, true)); + if(pContext.getLevel().getBlockState(pContext.getClickedPos()).is(ModBlocks.COOKING_POT.get())){ + if(!pContext.getLevel().getBlockState(pContext.getClickedPos()).getValue(COVER)) { + pContext.getLevel().setBlockAndUpdate(pContext.getClickedPos(), pContext.getLevel().getBlockState(pContext.getClickedPos()).setValue(COVER, true)); + } + return InteractionResult.SUCCESS; } - return InteractionResult.SUCCESS; + return InteractionResult.PASS; } } diff --git a/src/main/resources/assets/lingshi/textures/item/cooked_rice.png b/src/main/resources/assets/lingshi/textures/item/cooked_rice.png new file mode 100644 index 0000000000000000000000000000000000000000..6ff0169bee3e58e368706fc47919ef01ca69bad4 GIT binary patch literal 390 zcmV;10eSw3P)AphXt7|Zir~;mL==ZkIw|NEI27I7MI6Kr@F%2$og6#(0dBfDI8=mc ziw;TEG!1RiB*w|oG!fhc@A%$3hs))`Uq|@qqF%rA9LGRWJ^&~dw?p4X!VYT>*B*c* z$;k2y@pz7E_0s#5;Hgpb#PK8mmi3C`7_?d%0F}ylKoS{+J=Y`}O`&NznM?u8nk1D1 z*EMmR9_8|xPa+J%0G?~2X*$_#o@VnN%jzRZBC4tZ9op><0HxBA;A>FYTE;R}gy_To zw(TC0lmI~2bs$MPEpvK!JZLaBTxV}*1AvRG8*ICWVc3YGPPh9;KA+&^U_UUTPq0>q z(NOyAZmxz6&U7XUz{|T6+yG!{KIW}2ilHz-L+Nw-Xz{Fm4!FSQn45}t04oa;vpLZR k0zNoYFe>`aDEN=^1-0#mW+Dkd)&Kwi07*qoM6N<$g8lHQoB#j- literal 0 HcmV?d00001