Skip to content

Commit

Permalink
调整:烹饪锅和平底锅渲染,hud和tick
Browse files Browse the repository at this point in the history
  • Loading branch information
MCZME committed Aug 27, 2024
1 parent fc3943a commit 92f5fa7
Show file tree
Hide file tree
Showing 35 changed files with 400 additions and 146 deletions.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// 1.21 2024-08-22T18:03:26.4900985 Languages: zh_cn for mod: lingshi
2012858b997388159ffda305994f25429de3d030 assets/lingshi/lang/zh_cn.json
// 1.21 2024-08-27T05:38:33.2066749 Languages: zh_cn for mod: lingshi
c4e31085268a58b4bdb72f5cc12a36fecd42c0d3 assets/lingshi/lang/zh_cn.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
// 1.21 2024-08-27T02:55:56.0325835 Recipes
// 1.21 2024-08-27T06:08:36.0532515 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
6a319c97da924f9ab21b5d264c18cb8ad9da8755 data/lingshi/advancement/recipes/decorations/chopping_board.json
0a4b54bfda8aa98f1a26bbf1d8231c76ed12e770 data/lingshi/advancement/recipes/decorations/skillet.json
e4ccb4f32d90b93ef63a3f2a17e843c6a8b2322b data/lingshi/advancement/recipes/skillet/baked_potato.json
Expand All @@ -14,15 +17,18 @@ 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
e6daac4cca245fc9e220e2fcb1f2b27e410ba503 data/lingshi/recipe/iron_knife.json
a0c7fd85028ea7997689d7bc093b9d025c522ea6 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
e2328874e467cf5efdb65d0fedeac1cfe1677e98 data/lingshi/recipe/skillet/baked_potato.json
f028991439854ef986d28feab97a637b53df876a data/lingshi/recipe/skillet/cooked_beef.json
a7eb02ae67924077e8066c8cc2c5a05e02b5bb44 data/lingshi/recipe/skillet/cooked_chicken.json
09adfb28e337e8cc2333380dbfc8abaef2033c06 data/lingshi/recipe/skillet/cooked_cod.json
918165a19dfbbde26ca0397c107b3328fe0d6933 data/lingshi/recipe/skillet/cooked_mutton.json
c3cfbc2afc0b4cec90a57fdac12ec3bc7b462b4f data/lingshi/recipe/skillet/cooked_porkchop.json
c60918f7fafeb03f1c8244417c151ea7a5e44a31 data/lingshi/recipe/skillet/cooked_rabbit.json
e72067c16cd3f5e2ec6a11abb0c7a9e41d3e3fd4 data/lingshi/recipe/skillet/cooked_salmon.json
0c39fdabe7970065856b4adc9e9f3eae7690ea2d data/lingshi/recipe/skillet/fried_egg.json
3563171190654e76637de2fa78a6c750389674d7 data/lingshi/recipe/spatula.json
1 change: 1 addition & 0 deletions src/generated/resources/assets/lingshi/lang/zh_cn.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"block.lingshi.tea_tree": "茶树",
"gui.lingshi.cooking_pot_menu": "烹饪锅",
"gui.lingshi.skillet_menu": "平底锅",
"item.lingshi.cooked_rice": "米饭",
"item.lingshi.fried_egg": "煎鸡蛋",
"item.lingshi.iron_knife": "铁菜刀",
"item.lingshi.oil_bucket": "油桶",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_rice": {
"conditions": {
"items": [
{
"items": "lingshi:rice"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "lingshi:cooking_pot/cooked_rice"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_rice"
]
],
"rewards": {
"recipes": [
"lingshi:cooking_pot/cooked_rice"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_rice": {
"conditions": {
"items": [
{
"items": "lingshi:rice"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "lingshi:cooking_pot/cooked_rice_1"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_rice"
]
],
"rewards": {
"recipes": [
"lingshi:cooking_pot/cooked_rice_1"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
{
"parent": "minecraft:recipes/root",
"criteria": {
"has_rice": {
"conditions": {
"items": [
{
"items": "lingshi:rice"
}
]
},
"trigger": "minecraft:inventory_changed"
},
"has_the_recipe": {
"conditions": {
"recipe": "lingshi:cooking_pot/cooked_rice_2"
},
"trigger": "minecraft:recipe_unlocked"
}
},
"requirements": [
[
"has_the_recipe",
"has_rice"
]
],
"rewards": {
"recipes": [
"lingshi:cooking_pot/cooked_rice_2"
]
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"type": "lingshi:cooking_pot",
"container": {
"braising_time": 0,
"container": {
"count": 1,
"id": "minecraft:bowl"
}
},
"fluid": {
"amount": 1000,
"id": "minecraft:water"
},
"group": "",
"ingredients": [
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
}
],
"label": "boil",
"result": {
"count": 8,
"id": "lingshi:cooked_rice"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
{
"type": "lingshi:cooking_pot",
"container": {
"braising_time": 0,
"container": {
"count": 1,
"id": "minecraft:bowl"
}
},
"fluid": {
"amount": 1000,
"id": "minecraft:water"
},
"group": "",
"ingredients": [
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
}
],
"label": "boil",
"result": {
"count": 10,
"id": "lingshi:cooked_rice"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"type": "lingshi:cooking_pot",
"container": {
"braising_time": 0,
"container": {
"count": 1,
"id": "minecraft:bowl"
}
},
"fluid": {
"amount": 1000,
"id": "minecraft:water"
},
"group": "",
"ingredients": [
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
},
{
"item": "lingshi:rice"
}
],
"label": "boil",
"result": {
"count": 12,
"id": "lingshi:cooked_rice"
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:potato"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:beef"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:chicken"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:cod"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:mutton"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:porkchop"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:rabbit"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"type": "lingshi:skillet",
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:salmon"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"amount": 100,
"id": "lingshi:oil_source"
},
"group": "Skillet",
"group": "",
"ingredients": [
{
"item": "minecraft:egg"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,11 @@

import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.math.Axis;
import mczme.lingshi.common.block.ChoppingBoardBlock;
import mczme.lingshi.common.block.entity.CookingPotBlockEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.core.Direction;
import net.minecraft.world.item.ItemDisplayContext;
import net.neoforged.neoforge.fluids.FluidStack;
import net.neoforged.neoforge.items.ItemStackHandler;
Expand All @@ -27,7 +25,6 @@ public void render(CookingPotBlockEntity pBlockEntity, float pPartialTick, PoseS
if(!pBlockEntity.getBlockState().getValue(COVER)){
ItemStackHandler itemStack = pBlockEntity.getItemStacks();
FluidStack fluidStack = pBlockEntity.getFluid();
Direction direction = pBlockEntity.getBlockState().getValue(ChoppingBoardBlock.FACING);

if (!pBlockEntity.isEmpty()) {
if (!fluidStack.isEmpty()) {
Expand All @@ -37,8 +34,8 @@ public void render(CookingPotBlockEntity pBlockEntity, float pPartialTick, PoseS
for (int i = 0; i < pBlockEntity.getMAX(); i++) {
if (itemStack.getStackInSlot(i).isEmpty()) continue;
pPoseStack.pushPose();
pPoseStack.translate(0.5, 0.2 + i / 16.0, 0.5);
pPoseStack.mulPose(Axis.YP.rotationDegrees(-direction.toYRot()));
pPoseStack.translate(1.5*i/16F+0.25, 0.3, 0.5);
pPoseStack.mulPose(Axis.YP.rotationDegrees(90));
pPoseStack.scale(0.5F, 0.5F, 0.5F);
Minecraft.getInstance().getItemRenderer().renderStatic(itemStack.getStackInSlot(i), ItemDisplayContext.FIXED, pPackedLight, pPackedOverlay, pPoseStack, pBufferSource, pBlockEntity.getLevel(), (int) pBlockEntity.getBlockPos().asLong());
pPoseStack.popPose();
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/mczme/lingshi/client/event/Registry.java
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public static void registerRecipeBook(RegisterRecipeBookCategoriesEvent event) {
});
// Cooking Pot
event.registerBookCategories(COOKING_POT, ImmutableList.of(COOKING_POT_SEARCH.get(), COOKING_POT_POT_BOIL.get(), COOKING_POT_STEW.get(), COOKING_POT_DEEP_FRY.get(), COOKING_POT_MISC.get()));
event.registerAggregateCategory(SKILLET_SEARCH.get(), ImmutableList.of(COOKING_POT_POT_BOIL.get(), COOKING_POT_STEW.get(), COOKING_POT_DEEP_FRY.get(), COOKING_POT_MISC.get()));
event.registerAggregateCategory(COOKING_POT_SEARCH.get(), ImmutableList.of(COOKING_POT_POT_BOIL.get(), COOKING_POT_STEW.get(), COOKING_POT_DEEP_FRY.get(), COOKING_POT_MISC.get()));
event.registerRecipeCategoryFinder(ModRecipes.COOKING_POT_RECIPE.get(), recipe ->
{
if (recipe.value() instanceof SkilletRecipe Recipe) {
Expand Down
2 changes: 0 additions & 2 deletions src/main/java/mczme/lingshi/client/menu/CookingPotMenu.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,7 @@ private void addWorkSlot(ItemStackHandler itemStacks) {
slot.set(itemStacks.getStackInSlot(i));
this.addSlot(slot);
}
itemStackHandler.setStackInSlot(6,blockEntity.container);
this.addSlot(new ResultSlot(itemStackHandler, 6, X[6], Y[6]));
itemStackHandler.setStackInSlot(7,blockEntity.result);
this.addSlot(new ResultSlot(itemStackHandler, 7, X[7], Y[7]));
}

Expand Down
Loading

0 comments on commit 92f5fa7

Please sign in to comment.