Skip to content

Commit

Permalink
添加:米饭材质
Browse files Browse the repository at this point in the history
  • Loading branch information
MCZME committed Aug 27, 2024
1 parent e340120 commit 7be04c0
Show file tree
Hide file tree
Showing 12 changed files with 29 additions and 18 deletions.
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"parent": "minecraft:item/generated",
"textures": {
"layer0": "lingshi:item/cooked_rice"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"amount": 1000,
"id": "minecraft:water"
},
"group": "",
"group": "rice",
"ingredients": [
{
"item": "lingshi:rice"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"amount": 1000,
"id": "minecraft:water"
},
"group": "",
"group": "rice",
"ingredients": [
{
"item": "lingshi:rice"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"amount": 1000,
"id": "minecraft:water"
},
"group": "",
"group": "rice",
"ingredients": [
{
"item": "lingshi:rice"
Expand Down
6 changes: 3 additions & 3 deletions src/main/java/mczme/lingshi/client/screen/CookingHud.java
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -337,5 +337,4 @@ public static <T extends BlockEntity> void serverTick(Level pLevel, BlockPos pPo
blockEntity.setChanged();
}
}

}
1 change: 1 addition & 0 deletions src/main/java/mczme/lingshi/common/data/ItemModels.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));

Expand Down
10 changes: 7 additions & 3 deletions src/main/java/mczme/lingshi/common/item/PotLid.java
Original file line number Diff line number Diff line change
@@ -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;
Expand All @@ -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;
}

}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 7be04c0

Please sign in to comment.