From d5481df49abcfe99adb00419af3429f61c2330d0 Mon Sep 17 00:00:00 2001 From: MCZME <13183052+mczme@user.noreply.gitee.com> Date: Sat, 31 Aug 2024 03:13:32 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=EF=BC=9A=E5=8F=AF=E6=94=BE?= =?UTF-8?q?=E7=BD=AE=E9=A3=9F=E7=89=A9=EF=BC=8C=E7=8C=AA=E8=84=9A=E9=A5=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../59eb3dbb5f86130e09b3c62d89b9525ee01cf52d | 3 +- .../71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 | 3 +- .../85f12f813aff948f91f5cd129c0ffa86bcb17361 | 4 +- .../9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e | 4 +- .../a189ba72f94c72036c5b4a6381591ea76d224567 | 2 +- .../e0d3d0b8d9c807675613821fa865a35f707cd83f | 4 +- .../resources/assets/lingshi/lang/zh_cn.json | 1 + .../lingshi/models/item/pork_feet_rice.json | 6 + .../recipes/cooking_pot/pork_feet_rice.json | 32 ++ .../data_maps/item/cooking_food_item.json | 4 + .../recipe/cooking_pot/pork_feet_rice.json | 34 +++ .../lingshi/common/block/CookingPotBlock.java | 14 +- .../mczme/lingshi/common/block/FoodBlock.java | 85 ++++++ .../lingshi/common/block/SkilletBlock.java | 4 +- .../block/entity/CookingPotBlockEntity.java | 65 +++-- .../lingshi/common/data/BlockStates.java | 1 + .../common/data/CookingFoodDataGen.java | 1 + .../mczme/lingshi/common/data/ItemModels.java | 1 + .../data/lang/ChineseLanguageProvider.java | 3 +- .../data/recipe/CookingPotRecipeDataGen.java | 4 + .../lingshi/common/item/FoodBlockItem.java | 29 ++ .../lingshi/common/registry/ModBlocks.java | 2 + .../lingshi/common/registry/ModItems.java | 3 + .../lingshi/blockstates/pork_feet_rice.json | 34 +++ .../assets/lingshi/models/block/bowl.json | 171 +++++++++++ .../lingshi/models/block/pork_feet_rice.json | 276 ++++++++++++++++++ .../assets/lingshi/textures/block/bowl.png | Bin 0 -> 320 bytes .../lingshi/textures/block/pork_feet_rice.png | Bin 0 -> 547 bytes .../lingshi/textures/item/pork_feet_rice.png | Bin 0 -> 390 bytes .../loot_table/blocks/pork_feet_rice.json | 36 +++ 30 files changed, 788 insertions(+), 38 deletions(-) create mode 100644 src/generated/resources/assets/lingshi/models/item/pork_feet_rice.json create mode 100644 src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/pork_feet_rice.json create mode 100644 src/generated/resources/data/lingshi/recipe/cooking_pot/pork_feet_rice.json create mode 100644 src/main/java/mczme/lingshi/common/block/FoodBlock.java create mode 100644 src/main/java/mczme/lingshi/common/item/FoodBlockItem.java create mode 100644 src/main/resources/assets/lingshi/blockstates/pork_feet_rice.json create mode 100644 src/main/resources/assets/lingshi/models/block/bowl.json create mode 100644 src/main/resources/assets/lingshi/models/block/pork_feet_rice.json create mode 100644 src/main/resources/assets/lingshi/textures/block/bowl.png create mode 100644 src/main/resources/assets/lingshi/textures/block/pork_feet_rice.png create mode 100644 src/main/resources/assets/lingshi/textures/item/pork_feet_rice.png create mode 100644 src/main/resources/data/lingshi/loot_table/blocks/pork_feet_rice.json diff --git a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d index ffd7cdf..7d0d3bc 100644 --- a/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d +++ b/src/generated/resources/.cache/59eb3dbb5f86130e09b3c62d89b9525ee01cf52d @@ -1,6 +1,7 @@ -// 1.21 2024-08-28T08:40:40.9916727 Loot Tables +// 1.21 2024-08-31T01:19:03.5348268 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 17fa5fe..00242e7 100644 --- a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 +++ b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 @@ -1,4 +1,4 @@ -// 1.21 2024-08-30T12:20:36.9561227 Item Models: lingshi +// 1.21 2024-08-31T02:52:29.9900421 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 @@ -13,6 +13,7 @@ bad0cb5e093fa42331c2d4a1157d1a7b5b3fc588 assets/lingshi/models/item/chopping_boa 8889a4deb394774a900a518a3d4849db21da3370 assets/lingshi/models/item/noodles.json b767fc7952daf0eff3485fe4d8c06c5bba930c22 assets/lingshi/models/item/oil_bucket.json 8a787e79ccb05e02b90ea12cfed0a54b8fda4bf5 assets/lingshi/models/item/pig_feet.json +9915c87a8e0b4628efc95f82b478e53d6d59e46f assets/lingshi/models/item/pork_feet_rice.json 496d711c2d4af0f851d40f859b102da69188089d assets/lingshi/models/item/rice.json abe8ae1523c26af167289fe958382b2477d96ea1 assets/lingshi/models/item/rice_of_ear.json 57cfb1f90de649ab0f56f107cb56e1d0d2f87ae6 assets/lingshi/models/item/rice_seedling.json diff --git a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 index c0750e1..1257032 100644 --- a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 +++ b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 @@ -1,2 +1,2 @@ -// 1.21 2024-08-30T10:29:45.4757545 Languages: zh_cn for mod: lingshi -8b3befb4d46c34070ed009c796a764b76640c942 assets/lingshi/lang/zh_cn.json +// 1.21 2024-08-30T23:36:41.7027359 Languages: zh_cn for mod: lingshi +881d9198efe03b2e63a7b1055a09e0d6e3057727 assets/lingshi/lang/zh_cn.json diff --git a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e index d14cf42..9a156af 100644 --- a/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e +++ b/src/generated/resources/.cache/9fb1092f32d4fcbf9e061ffd718d4ec689c6c95e @@ -1,7 +1,8 @@ -// 1.21 2024-08-30T12:20:36.9581216 Recipes +// 1.21 2024-08-30T23:36:41.69974 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 +5cc97ddff81d0a9274cb38f2e28b05aec86be255 data/lingshi/advancement/recipes/cooking_pot/pork_feet_rice.json 6a319c97da924f9ab21b5d264c18cb8ad9da8755 data/lingshi/advancement/recipes/decorations/chopping_board.json 316ee6a89da986357d408cff58db9554636fc16a data/lingshi/advancement/recipes/decorations/cooking_pot.json 0486b842988b1d1ac0abb797a91d26077583679e data/lingshi/advancement/recipes/decorations/pot_lid.json @@ -29,6 +30,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 e6daac4cca245fc9e220e2fcb1f2b27e410ba503 data/lingshi/recipe/iron_knife.json dba470601fa51254c73ae3c63fa858de333a48c2 data/lingshi/recipe/pot_lid.json a0c7fd85028ea7997689d7bc093b9d025c522ea6 data/lingshi/recipe/skillet.json diff --git a/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 b/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 index 98d74a9..6178b19 100644 --- a/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 +++ b/src/generated/resources/.cache/a189ba72f94c72036c5b4a6381591ea76d224567 @@ -1,2 +1,2 @@ -// 1.21 2024-08-28T10:28:02.8785778 Block States: lingshi +// 1.21 2024-08-31T02:52:29.9920421 Block States: lingshi c5265867b72222a7b9a0c319c8593c91a69953ab assets/lingshi/blockstates/chopping_board.json diff --git a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f index 583c6f4..05374af 100644 --- a/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f +++ b/src/generated/resources/.cache/e0d3d0b8d9c807675613821fa865a35f707cd83f @@ -1,3 +1,3 @@ -// 1.21 2024-08-30T10:29:45.4707514 Data Maps +// 1.21 2024-08-30T23:36:41.6977366 Data Maps f8714336008bf2256e4e28ae34f31dd942431f35 data/lingshi/data_maps/fluid/cooking_food_fliud.json -ed35888eac82dacc826f4916e71edbb3ec9775f7 data/lingshi/data_maps/item/cooking_food_item.json +bc1c7ba60707a60cfeffda40b6186ef095cfe7dc 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 0d0959b..cc081ba 100644 --- a/src/generated/resources/assets/lingshi/lang/zh_cn.json +++ b/src/generated/resources/assets/lingshi/lang/zh_cn.json @@ -2,6 +2,7 @@ "block.lingshi.cabbage": "白菜种子", "block.lingshi.chopping_board": "砧板", "block.lingshi.cooking_pot": "烹饪锅", + "block.lingshi.pork_feet_rice": "猪脚饭", "block.lingshi.rice": "稻米", "block.lingshi.rice_seedling": "稻苗", "block.lingshi.skillet": "平底锅", diff --git a/src/generated/resources/assets/lingshi/models/item/pork_feet_rice.json b/src/generated/resources/assets/lingshi/models/item/pork_feet_rice.json new file mode 100644 index 0000000..7e09696 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/pork_feet_rice.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "lingshi:item/pork_feet_rice" + } +} \ No newline at end of file diff --git a/src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/pork_feet_rice.json b/src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/pork_feet_rice.json new file mode 100644 index 0000000..92553ef --- /dev/null +++ b/src/generated/resources/data/lingshi/advancement/recipes/cooking_pot/pork_feet_rice.json @@ -0,0 +1,32 @@ +{ + "parent": "minecraft:recipes/root", + "criteria": { + "has_pig_feet": { + "conditions": { + "items": [ + { + "items": "lingshi:pig_feet" + } + ] + }, + "trigger": "minecraft:inventory_changed" + }, + "has_the_recipe": { + "conditions": { + "recipe": "lingshi:cooking_pot/pork_feet_rice" + }, + "trigger": "minecraft:recipe_unlocked" + } + }, + "requirements": [ + [ + "has_the_recipe", + "has_pig_feet" + ] + ], + "rewards": { + "recipes": [ + "lingshi:cooking_pot/pork_feet_rice" + ] + } +} \ 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 a00b290..7a49a60 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 @@ -1,5 +1,9 @@ { "values": { + "lingshi:cabbage_leaf": { + "burnt_time": 12, + "cooked_time": 3 + }, "lingshi:pig_feet": { "burnt_time": 20, "cooked_time": 8 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 new file mode 100644 index 0000000..0c5be2b --- /dev/null +++ b/src/generated/resources/data/lingshi/recipe/cooking_pot/pork_feet_rice.json @@ -0,0 +1,34 @@ +{ + "type": "lingshi:cooking_pot", + "container": { + "braising_time": 5, + "container": { + "count": 1, + "id": "minecraft:bowl" + } + }, + "fluid": { + "amount": 1000, + "id": "minecraft:water" + }, + "group": "", + "ingredients": [ + { + "item": "lingshi:rice" + }, + { + "item": "lingshi:rice" + }, + { + "item": "lingshi:cabbage_leaf" + }, + { + "item": "lingshi:pig_feet" + } + ], + "label": "boil", + "result": { + "count": 2, + "id": "lingshi:pork_feet_rice" + } +} \ No newline at end of file diff --git a/src/main/java/mczme/lingshi/common/block/CookingPotBlock.java b/src/main/java/mczme/lingshi/common/block/CookingPotBlock.java index f0acc91..5566443 100644 --- a/src/main/java/mczme/lingshi/common/block/CookingPotBlock.java +++ b/src/main/java/mczme/lingshi/common/block/CookingPotBlock.java @@ -55,16 +55,17 @@ public ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Leve if (!blockEntity.getItemStacks().getStackInSlot(6).isEmpty() && pStack.is(blockEntity.getItemStacks().getStackInSlot(6).getItem())) { if (pPlayer.addItem(new ItemStack(blockEntity.getItemStacks().getStackInSlot(7).getItem(), 1))) { blockEntity.getItemStacks().getStackInSlot(7).shrink(1); - pStack.consume(1, pPlayer); + if(!pStack.is(ModItems.SPATULA.get())){ + pStack.consume(1, pPlayer); + } + blockEntity.stewingTime = 0; blockEntity.setChanged(); return ItemInteractionResult.SUCCESS; } } else if (pStack.is(ModItems.SPATULA.get())) { - if (blockEntity.size() == 0) { - blockEntity.setFluid(FluidStack.EMPTY); - blockEntity.setChanged(); - return ItemInteractionResult.SUCCESS; - } + blockEntity.clearDrop(pLevel,pPos); + blockEntity.setChanged(); + return ItemInteractionResult.SUCCESS; } else if (!blockEntity.isFull() && !pStack.isEmpty() && !pStack.is(ModItems.POT_LID.get()) && !pState.getValue(COVER)) { if (pStack.is(Items.WATER_BUCKET)) { blockEntity.setFluid(new FluidStack(Fluids.WATER, 1000)); @@ -97,7 +98,6 @@ protected InteractionResult useWithoutItem(BlockState pState, Level pLevel, Bloc if (pState.getValue(COVER)) { pLevel.setBlockAndUpdate(pPos, pState.setValue(COVER, false)); Containers.dropItemStack(pLevel, pPos.getX(), pPos.getY() + 0.7, pPos.getZ(), new ItemStack(ModItems.POT_LID.get())); - blockEntity.stewingTime = 0; return InteractionResult.SUCCESS; } else if (pPlayer.isShiftKeyDown()) { pPlayer.openMenu(blockEntity, pPos); diff --git a/src/main/java/mczme/lingshi/common/block/FoodBlock.java b/src/main/java/mczme/lingshi/common/block/FoodBlock.java new file mode 100644 index 0000000..a349f19 --- /dev/null +++ b/src/main/java/mczme/lingshi/common/block/FoodBlock.java @@ -0,0 +1,85 @@ +package mczme.lingshi.common.block; + +import net.minecraft.core.BlockPos; +import net.minecraft.core.Direction; +import net.minecraft.world.InteractionHand; +import net.minecraft.world.ItemInteractionResult; +import net.minecraft.world.entity.player.Player; +import net.minecraft.world.item.ItemStack; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.level.BlockGetter; +import net.minecraft.world.level.Level; +import net.minecraft.world.level.LevelAccessor; +import net.minecraft.world.level.LevelReader; +import net.minecraft.world.level.block.Block; +import net.minecraft.world.level.block.Blocks; +import net.minecraft.world.level.block.state.BlockState; +import net.minecraft.world.level.block.state.StateDefinition; +import net.minecraft.world.level.block.state.properties.BlockStateProperties; +import net.minecraft.world.level.block.state.properties.DirectionProperty; +import net.minecraft.world.level.block.state.properties.IntegerProperty; +import net.minecraft.world.level.pathfinder.PathComputationType; +import net.minecraft.world.phys.BlockHitResult; +import net.minecraft.world.phys.shapes.CollisionContext; +import net.minecraft.world.phys.shapes.Shapes; +import net.minecraft.world.phys.shapes.VoxelShape; + +public class FoodBlock extends Block { + + public static final DirectionProperty FACING = BlockStateProperties.HORIZONTAL_FACING; + 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)) ; + + 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) { + pLevel.destroyBlock(pPos, true); + return ItemInteractionResult.SUCCESS; + }else { + if(pPlayer.canEat(false)) { + pLevel.setBlock(pPos, pState.setValue(AMOUNT, 0), Block.UPDATE_CLIENTS); + pPlayer.eat(pLevel, new ItemStack(pState.getBlock().asItem())); + return ItemInteractionResult.SUCCESS; + } + } + return ItemInteractionResult.PASS_TO_DEFAULT_BLOCK_INTERACTION; + } + + @Override + protected VoxelShape getShape(BlockState pState, BlockGetter pLevel, BlockPos pPos, CollisionContext pContext) { + return SHAPE; + } + + @Override + protected boolean canSurvive(BlockState pState, LevelReader pLevel, BlockPos pPos) { + return canSupportRigidBlock(pLevel, pPos.below()) || canSupportCenter(pLevel, pPos.below(), Direction.UP); + } + + @Override + public BlockState getStateForPlacement(BlockPlaceContext pContext) { + return this.defaultBlockState().setValue(FACING, pContext.getHorizontalDirection()).setValue(AMOUNT, 1); + } + + @Override + public BlockState updateShape(BlockState pState, Direction pFacing, BlockState pFacingState, LevelAccessor pLevel, BlockPos pCurrentPos, BlockPos pFacingPos) { + if (!pState.canSurvive(pLevel, pCurrentPos)) { + return Blocks.AIR.defaultBlockState(); + } + return super.updateShape(pState, pFacing, pFacingState, pLevel, pCurrentPos, pFacingPos); + } + + @Override + protected boolean isPathfindable(BlockState pState, PathComputationType pPathComputationType) { + return false; + } + + @Override + protected void createBlockStateDefinition(StateDefinition.Builder pBuilder) { + pBuilder.add(FACING, AMOUNT); + } +} diff --git a/src/main/java/mczme/lingshi/common/block/SkilletBlock.java b/src/main/java/mczme/lingshi/common/block/SkilletBlock.java index a77d6ed..9ce6cc7 100644 --- a/src/main/java/mczme/lingshi/common/block/SkilletBlock.java +++ b/src/main/java/mczme/lingshi/common/block/SkilletBlock.java @@ -61,7 +61,9 @@ public ItemInteractionResult useItemOn(ItemStack pStack, BlockState pState, Leve if (pLevel.getBlockEntity(pPos) instanceof SkilletBlockEntity blockEntity) { if (!blockEntity.getItemStacks().getStackInSlot(5).isEmpty() && pStack.is(blockEntity.getItemStacks().getStackInSlot(5).getItem())) { if (pPlayer.addItem(blockEntity.result)) { - pStack.consume(1, pPlayer); + if(!pStack.is(ModItems.SPATULA.get())){ + pStack.consume(1, pPlayer); + } blockEntity.clear(); blockEntity.setChanged(); return ItemInteractionResult.SUCCESS; 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 a39c25e..6296f73 100644 --- a/src/main/java/mczme/lingshi/common/block/entity/CookingPotBlockEntity.java +++ b/src/main/java/mczme/lingshi/common/block/entity/CookingPotBlockEntity.java @@ -8,6 +8,7 @@ import mczme.lingshi.common.recipe.CookingPotRecipe; import mczme.lingshi.common.recipe.input.CookingFoodRecipeInput; import mczme.lingshi.common.registry.BlockEntityTypes; +import mczme.lingshi.common.registry.ModItems; import mczme.lingshi.common.registry.ModRecipes; import mczme.lingshi.lingshi; import net.minecraft.core.BlockPos; @@ -19,6 +20,7 @@ import net.minecraft.network.protocol.Packet; import net.minecraft.network.protocol.game.ClientGamePacketListener; import net.minecraft.network.protocol.game.ClientboundBlockEntityDataPacket; +import net.minecraft.world.Containers; import net.minecraft.world.MenuProvider; import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; @@ -44,7 +46,7 @@ public class CookingPotBlockEntity extends BlockEntity implements ICanBeHeated, private final int MAX_SLOT = 6; private FluidStack fluidStacks = FluidStack.EMPTY; - private final CookingItemStackHandler itemStackHandler = new CookingItemStackHandler(MAX_SLOT + 2,16); + private final CookingItemStackHandler itemStackHandler = new CookingItemStackHandler(MAX_SLOT + 2, 16); private final int[] cookingTime = new int[MAX_SLOT + 1]; public ItemStack result = ItemStack.EMPTY; @@ -120,6 +122,19 @@ public int size() { return size; } + public void clearDrop(Level pLevel, BlockPos pPos) { + result = ItemStack.EMPTY; + for (int i = 0; i < MAX_SLOT; i++) { + if (!itemStackHandler.getStackInSlot(i).isEmpty()) { + Containers.dropItemStack(pLevel, pPos.getX(), pPos.getY() + 0.5, pPos.getZ(), dropItem()); + itemStackHandler.setStackInSlot(i, ItemStack.EMPTY); + } + } + fluidStacks = FluidStack.EMPTY; + clearTime(); + stewingTime = 0; + } + public void clear() { result = ItemStack.EMPTY; for (int i = 0; i < MAX_SLOT; i++) { @@ -127,7 +142,7 @@ public void clear() { } fluidStacks = FluidStack.EMPTY; clearTime(); - stewingTime=0; + stewingTime = 0; } public void clearTime() { @@ -140,22 +155,22 @@ public int[] getCookingTime() { } @Override - public ItemStack getResult(){ + public ItemStack getResult() { return result; } - public void consume(int count){ + public void consume(int count) { if (count > 0) { boolean t = true; for (int i = 0; i < MAX_SLOT; i++) { if (!itemStackHandler.getStackInSlot(i).isEmpty()) { itemStackHandler.getStackInSlot(i).shrink(count); - if(!itemStackHandler.getStackInSlot(i).isEmpty()){ - t=false; + if (!itemStackHandler.getStackInSlot(i).isEmpty()) { + t = false; } } } - if(t){ + if (t) { clear(); } } @@ -260,9 +275,9 @@ public static void serverTick(Level pLevel, BlockPos pPo } if (heat_flag) { if (!flag) { - int cookedTime = 0; - int cooked_size = 0; - boolean fluid_heated= blockEntity.getFluid().isEmpty(); + int cookedTime = 0, burntTime = 0; + int cooked_size = 0, burnt_size = 0; + boolean fluid_heated = blockEntity.getFluid().isEmpty(); // 获取配方 CookingFoodRecipeInput input = new CookingFoodRecipeInput(inputStackHandler, blockEntity.getFluid()); Optional> optional = pLevel.getRecipeManager().getRecipeFor( @@ -274,10 +289,10 @@ public static void serverTick(Level pLevel, BlockPos pPo .map(e -> e.assemble(input, pLevel.registryAccess())) .orElse(ItemStack.EMPTY); int stewTime = optional.map(RecipeHolder::value) - .map(e->e.getContainer().braisingTime()) + .map(e -> e.getContainer().braisingTime()) .orElse(0); //cookProgress - if(!blockState.getValue(COVER)&&(itemStackHandler.getStackInSlot(7).isEmpty()||(itemStackHandler.getStackInSlot(7).is(result1.getItem())&&itemStackHandler.getStackInSlot(7).getCount()<64))){ + if (!blockState.getValue(COVER) && (itemStackHandler.getStackInSlot(7).isEmpty() || (itemStackHandler.getStackInSlot(7).is(result1.getItem()) && itemStackHandler.getStackInSlot(7).getCount() < 64))) { for (int i = 0; i < MAX_SLOT + 1; i++) { //fluid if (i == MAX_SLOT) { @@ -304,32 +319,40 @@ public static void serverTick(Level pLevel, BlockPos pPo CookingFoodData cookingFoodData = itemStack.getItemHolder().getData(DataMapTypes.COOKING_FOOD_ITEM); if (cookingFoodData != null) { cookedTime = cookingFoodData.cookedTime(); + burntTime = cookingFoodData.burntTime(); blockEntity.cookingTime[i]++; } - if (blockEntity.cookingTime[i] > cookedTime * 20) { + if (blockEntity.cookingTime[i] > burntTime * 20 && burntTime != 0) { + burnt_size++; + } else if (blockEntity.cookingTime[i] > cookedTime * 20 && cookedTime != 0) { cooked_size++; } } - }else { + } else if (blockState.getValue(COVER)) { blockEntity.stewingTime++; } // 结果判断 - blockEntity.result=result1; - if (cooked_size == blockEntity.size() && !blockEntity.result.isEmpty() && fluid_heated && itemStackHandler.getStackInSlot(7).getCount()<=64&&blockEntity.stewingTime/20>= stewTime) { - itemStackHandler.setStackInSlot(6,optional.map(RecipeHolder::value) + blockEntity.result = result1; + if (cooked_size == blockEntity.size() && !blockEntity.result.isEmpty() && fluid_heated && itemStackHandler.getStackInSlot(7).getCount() <= 64 && blockEntity.stewingTime / 20 >= stewTime) { + itemStackHandler.setStackInSlot(6, optional.map(RecipeHolder::value) .map(e -> e.getContainer().container()) .orElse(ItemStack.EMPTY)); - if(!itemStackHandler.getStackInSlot(7).isEmpty()){ + if (!itemStackHandler.getStackInSlot(7).isEmpty()) { itemStackHandler.getStackInSlot(7).grow(blockEntity.getResult().getCount()); - }else { - blockEntity.setItem(blockEntity.result,7); + } else { + blockEntity.setItem(blockEntity.result, 7); } blockEntity.consume(1); + } else if (burnt_size == blockEntity.size() && burnt_size != 0) { + blockEntity.setItem(new ItemStack(ModItems.STRANGE_FOOD.get()), 7); + blockEntity.setItem(new ItemStack(ModItems.SPATULA.get()),6); + blockEntity.clear(); } } else { - if(itemStackHandler.getStackInSlot(7).isEmpty()){ + if (itemStackHandler.getStackInSlot(7).isEmpty()) { itemStackHandler.setStackInSlot(6, ItemStack.EMPTY); } + blockEntity.stewingTime = 0; blockEntity.clearTime(); blockEntity.result = ItemStack.EMPTY; } diff --git a/src/main/java/mczme/lingshi/common/data/BlockStates.java b/src/main/java/mczme/lingshi/common/data/BlockStates.java index ec4b2d5..c41447e 100644 --- a/src/main/java/mczme/lingshi/common/data/BlockStates.java +++ b/src/main/java/mczme/lingshi/common/data/BlockStates.java @@ -23,6 +23,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"); } private void horizontalBlock(Block block, String modelLocation) { diff --git a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java index be0bbd8..a0a84a0 100644 --- a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java @@ -38,6 +38,7 @@ protected void gather() { addCookingFood(Items.SALMON,5,20); addCookingFood(Items.EGG,3,12); addCookingFood(ModItems.PIG_FEET,8,20); + addCookingFood(ModItems.CABBAGE_LEAF.get(),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 bbd22a6..43dbb1e 100644 --- a/src/main/java/mczme/lingshi/common/data/ItemModels.java +++ b/src/main/java/mczme/lingshi/common/data/ItemModels.java @@ -19,6 +19,7 @@ protected void registerModels() { basicItem(ModItems.CABBAGE_SEED.get()); basicItem(ModItems.CABBAGE.get()); basicItem(ModItems.CABBAGE_LEAF.get()); + basicItem(ModItems.PORK_FEET_RICE.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 b1f4e03..27c22f2 100644 --- a/src/main/java/mczme/lingshi/common/data/lang/ChineseLanguageProvider.java +++ b/src/main/java/mczme/lingshi/common/data/lang/ChineseLanguageProvider.java @@ -13,7 +13,7 @@ public ChineseLanguageProvider(PackOutput output) { @Override protected void addTranslations() { - this.add("lingshi.lingshi_tab", "灵食"); + this.add("lingshi.lingshi_tab", "零食"); this.add(ModItems.RICE.get(), "稻米"); this.add(ModItems.RICE_SEEDLING.get(), "稻苗"); @@ -45,6 +45,7 @@ protected void addTranslations() { this.add(ModItems.DOUGH.get(), "面团"); this.add(ModItems.NOODLES.get(), "面条"); this.add(ModItems.PIG_FEET.get(), "猪蹄"); + this.add(ModItems.PORK_FEET_RICE.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 6d456c0..74773c4 100644 --- a/src/main/java/mczme/lingshi/common/data/recipe/CookingPotRecipeDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/recipe/CookingPotRecipeDataGen.java @@ -35,6 +35,10 @@ protected void buildRecipes(RecipeOutput output) { .unlockedBy("has_rice", has(ModItems.RICE.get())).group("rice") .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),0)) .save(output,create("cooked_rice_2")); + build(List.of(Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.RICE.get()),Ingredient.of(ModItems.CABBAGE_LEAF.get()),Ingredient.of(ModItems.PIG_FEET.get())),new FluidStack(Fluids.WATER,1000),new ItemStack(ModItems.PORK_FEET_RICE.get(),2),CookingFoodRecipeLabel.BOIL) + .unlockedBy("has_pig_feet", has(ModItems.PIG_FEET.get())) + .setContainer(new CookingPotRecipe.CookingPotContainer(new ItemStack(Items.BOWL),5)) + .save(output,create("pork_feet_rice")); } diff --git a/src/main/java/mczme/lingshi/common/item/FoodBlockItem.java b/src/main/java/mczme/lingshi/common/item/FoodBlockItem.java new file mode 100644 index 0000000..cdada9a --- /dev/null +++ b/src/main/java/mczme/lingshi/common/item/FoodBlockItem.java @@ -0,0 +1,29 @@ +package mczme.lingshi.common.item; + +import net.minecraft.core.component.DataComponents; +import net.minecraft.world.InteractionResult; +import net.minecraft.world.item.BlockItem; +import net.minecraft.world.item.context.BlockPlaceContext; +import net.minecraft.world.item.context.UseOnContext; +import net.minecraft.world.level.block.Block; + +public class FoodBlockItem extends BlockItem { + + public FoodBlockItem(Block pBlock, Properties pProperties) { + super(pBlock, pProperties); + } + + @Override + public InteractionResult useOn(UseOnContext pContext) { + InteractionResult interactionresult = InteractionResult.FAIL; + if(pContext.getPlayer().isShiftKeyDown()){ + interactionresult = this.place(new BlockPlaceContext(pContext)); + } + if (!interactionresult.consumesAction() && pContext.getItemInHand().has(DataComponents.FOOD)) { + InteractionResult interactionresult1 = super.use(pContext.getLevel(), pContext.getPlayer(), pContext.getHand()).getResult(); + return interactionresult1 == InteractionResult.CONSUME ? InteractionResult.CONSUME_PARTIAL : interactionresult1; + } else { + return interactionresult; + } + } +} diff --git a/src/main/java/mczme/lingshi/common/registry/ModBlocks.java b/src/main/java/mczme/lingshi/common/registry/ModBlocks.java index f8c38ff..c75b0e5 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModBlocks.java +++ b/src/main/java/mczme/lingshi/common/registry/ModBlocks.java @@ -42,6 +42,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 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 45c86c7..1969db1 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModItems.java +++ b/src/main/java/mczme/lingshi/common/registry/ModItems.java @@ -1,5 +1,6 @@ package mczme.lingshi.common.registry; +import mczme.lingshi.common.item.FoodBlockItem; import mczme.lingshi.common.item.KnifeItem; import mczme.lingshi.common.item.PotLid; import mczme.lingshi.common.item.SpatulaItem; @@ -46,6 +47,8 @@ public class ModItems { public static final Supplier DOUGH = registerWithCreateTab("dough", () -> new Item(new Item.Properties())); public static final Supplier NOODLES = registerWithCreateTab("noodles", () -> new Item(new Item.Properties().food(new FoodProperties.Builder().nutrition(2).saturationModifier(1f).build()))); public static final Supplier PIG_FEET = registerWithCreateTab("pig_feet", () -> new Item(new Item.Properties().food(new FoodProperties.Builder().nutrition(5).saturationModifier(3f).build()))); +//可放置食物 + 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().nutrition(12).saturationModifier(9.4f).build()))); private static Supplier registerWithCreateTab(String item_name, Supplier itemSupplier) { Supplier item = ITEMS.register(item_name, itemSupplier); diff --git a/src/main/resources/assets/lingshi/blockstates/pork_feet_rice.json b/src/main/resources/assets/lingshi/blockstates/pork_feet_rice.json new file mode 100644 index 0000000..ed9f35f --- /dev/null +++ b/src/main/resources/assets/lingshi/blockstates/pork_feet_rice.json @@ -0,0 +1,34 @@ +{ + "variants": { + "amount=0,facing=east": { + "model": "lingshi:block/bowl", + "y": 270 + }, + "amount=0,facing=north": { + "model": "lingshi:block/bowl", + "y": 180 + }, + "amount=0,facing=south": { + "model": "lingshi:block/bowl" + }, + "amount=0,facing=west": { + "model": "lingshi:block/bowl", + "y": 90 + }, + "amount=1,facing=east": { + "model": "lingshi:block/pork_feet_rice", + "y": 270 + }, + "amount=1,facing=north": { + "model": "lingshi:block/pork_feet_rice", + "y": 180 + }, + "amount=1,facing=south": { + "model": "lingshi:block/pork_feet_rice" + }, + "amount=1,facing=west": { + "model": "lingshi:block/pork_feet_rice", + "y": 90 + } + } +} \ No newline at end of file diff --git a/src/main/resources/assets/lingshi/models/block/bowl.json b/src/main/resources/assets/lingshi/models/block/bowl.json new file mode 100644 index 0000000..799da2a --- /dev/null +++ b/src/main/resources/assets/lingshi/models/block/bowl.json @@ -0,0 +1,171 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "lingshi:block/bowl", + "particle": "lingshi:block/bowl" + }, + "elements": [ + { + "from": [6, 1, 10], + "to": [10, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 1, 10]}, + "faces": { + "north": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [11, 0, 15, 1], "texture": "#0"}, + "up": {"uv": [11, 1, 15, 2], "texture": "#0"}, + "down": {"uv": [11, 0, 15, 1], "texture": "#0"} + } + }, + { + "from": [6, 0, 6], + "to": [10, 1, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 0, 6]}, + "faces": { + "north": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "east": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "south": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "west": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "up": {"uv": [0, 4, 4, 8], "texture": "#0"}, + "down": {"uv": [0, 4, 4, 8], "texture": "#0"} + } + }, + { + "from": [6, 1, 5], + "to": [10, 2, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 1, 5]}, + "faces": { + "north": {"uv": [11, 0, 15, 1], "texture": "#0"}, + "south": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [11, 1, 15, 2], "texture": "#0"}, + "down": {"uv": [11, 0, 15, 1], "texture": "#0"} + } + }, + { + "from": [5, 1, 5], + "to": [6, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 1, 7]}, + "faces": { + "north": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "east": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "west": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 1, 16, 2], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 16, 1], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10, 1, 5], + "to": [11, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [10, 1, 7]}, + "faces": { + "north": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "east": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "west": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 1, 16, 2], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 16, 1], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 2, 3], + "to": [5, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 2, 7]}, + "faces": { + "north": {"uv": [0, 0, 2, 0], "texture": "#0"}, + "up": {"uv": [6, 11, 16, 13], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 9, 10, 11], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [5, 2, 3], + "to": [11, 2, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 2, 4]}, + "faces": { + "north": {"uv": [0, 0, 6, 0], "texture": "#0"}, + "up": {"uv": [8, 11, 14, 13], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 13, 6, 15], "texture": "#0"} + } + }, + { + "from": [5, 2, 11], + "to": [11, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 2, 11]}, + "faces": { + "north": {"uv": [0, 9, 6, 9], "texture": "#0"}, + "up": {"uv": [8, 11, 14, 13], "texture": "#0"}, + "down": {"uv": [0, 11, 6, 13], "texture": "#0"} + } + }, + { + "from": [2, 2, 3], + "to": [3, 6, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 4, 7]}, + "faces": { + "north": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "east": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 1, 10, 0], "texture": "#0"} + } + }, + { + "from": [13, 2, 3], + "to": [14, 6, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 4, 7]}, + "faces": { + "north": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "west": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 10, 1], "texture": "#0"} + } + }, + { + "from": [3, 2, 13], + "to": [13, 6, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 4, 13]}, + "faces": { + "north": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "east": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "texture": "#0"}, + "down": {"uv": [0, 0, 10, 1], "texture": "#0"} + } + }, + { + "from": [3, 2, 2], + "to": [13, 6, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 4, 2]}, + "faces": { + "north": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "south": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "texture": "#0"}, + "down": {"uv": [0, 0, 10, 1], "texture": "#0"} + } + }, + { + "from": [11, 2, 3], + "to": [13, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [11, 2, 7]}, + "faces": { + "north": {"uv": [0, 0, 2, 0], "texture": "#0"}, + "up": {"uv": [6, 11, 16, 13], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 9, 10, 11], "rotation": 90, "texture": "#0"} + } + } + ], + "display": {}, + "groups": [ + { + "name": "bowl", + "origin": [11, 2, 7], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/lingshi/models/block/pork_feet_rice.json b/src/main/resources/assets/lingshi/models/block/pork_feet_rice.json new file mode 100644 index 0000000..25cb196 --- /dev/null +++ b/src/main/resources/assets/lingshi/models/block/pork_feet_rice.json @@ -0,0 +1,276 @@ +{ + "credit": "Made with Blockbench", + "textures": { + "0": "lingshi:block/bowl", + "1": "lingshi:block/pork_feet_rice", + "particle": "lingshi:block/bowl" + }, + "elements": [ + { + "from": [6, 1, 10], + "to": [10, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 1, 10]}, + "faces": { + "north": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [11, 0, 15, 1], "texture": "#0"}, + "up": {"uv": [11, 1, 15, 2], "texture": "#0"}, + "down": {"uv": [11, 0, 15, 1], "texture": "#0"} + } + }, + { + "from": [6, 0, 6], + "to": [10, 1, 10], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 0, 6]}, + "faces": { + "north": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "east": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "south": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "west": {"uv": [0, 8, 4, 9], "texture": "#0"}, + "up": {"uv": [0, 4, 4, 8], "texture": "#0"}, + "down": {"uv": [0, 4, 4, 8], "texture": "#0"} + } + }, + { + "from": [6, 1, 5], + "to": [10, 2, 6], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 1, 5]}, + "faces": { + "north": {"uv": [11, 0, 15, 1], "texture": "#0"}, + "south": {"uv": [12, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [11, 1, 15, 2], "texture": "#0"}, + "down": {"uv": [11, 0, 15, 1], "texture": "#0"} + } + }, + { + "from": [5, 1, 5], + "to": [6, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [5, 1, 7]}, + "faces": { + "north": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "east": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "west": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 1, 16, 2], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 16, 1], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [10, 1, 5], + "to": [11, 2, 11], + "rotation": {"angle": 0, "axis": "y", "origin": [10, 1, 7]}, + "faces": { + "north": {"uv": [10, 0, 11, 1], "texture": "#0"}, + "east": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "south": {"uv": [15, 0, 16, 1], "texture": "#0"}, + "west": {"uv": [10, 0, 16, 1], "texture": "#0"}, + "up": {"uv": [10, 1, 16, 2], "rotation": 90, "texture": "#0"}, + "down": {"uv": [10, 0, 16, 1], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 2, 3], + "to": [5, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [4, 2, 7]}, + "faces": { + "north": {"uv": [0, 0, 2, 0], "texture": "#0"}, + "up": {"uv": [6, 11, 16, 13], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 9, 10, 11], "rotation": 270, "texture": "#0"} + } + }, + { + "from": [5, 2, 3], + "to": [11, 2, 5], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 2, 4]}, + "faces": { + "north": {"uv": [0, 0, 6, 0], "texture": "#0"}, + "up": {"uv": [8, 11, 14, 13], "rotation": 180, "texture": "#0"}, + "down": {"uv": [0, 13, 6, 15], "texture": "#0"} + } + }, + { + "from": [5, 2, 11], + "to": [11, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 2, 11]}, + "faces": { + "north": {"uv": [0, 9, 6, 9], "texture": "#0"}, + "up": {"uv": [8, 11, 14, 13], "texture": "#0"}, + "down": {"uv": [0, 11, 6, 13], "texture": "#0"} + } + }, + { + "from": [2, 2, 3], + "to": [3, 6, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [2, 4, 7]}, + "faces": { + "north": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "east": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 1, 10, 0], "texture": "#0"} + } + }, + { + "from": [13, 2, 3], + "to": [14, 6, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [13, 4, 7]}, + "faces": { + "north": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "west": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "rotation": 90, "texture": "#0"}, + "down": {"uv": [0, 0, 10, 1], "texture": "#0"} + } + }, + { + "from": [3, 2, 13], + "to": [13, 6, 14], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 4, 13]}, + "faces": { + "north": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "east": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "south": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "texture": "#0"}, + "down": {"uv": [0, 0, 10, 1], "texture": "#0"} + } + }, + { + "from": [3, 2, 2], + "to": [13, 6, 3], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 4, 2]}, + "faces": { + "north": {"uv": [0, 0, 10, 4], "texture": "#0"}, + "east": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "south": {"uv": [4, 4, 14, 8], "texture": "#0"}, + "west": {"uv": [0, 0, 1, 4], "texture": "#0"}, + "up": {"uv": [0, 0, 10, 1], "texture": "#0"}, + "down": {"uv": [0, 0, 10, 1], "texture": "#0"} + } + }, + { + "from": [11, 2, 3], + "to": [13, 2, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [11, 2, 7]}, + "faces": { + "north": {"uv": [0, 0, 2, 0], "texture": "#0"}, + "up": {"uv": [6, 11, 16, 13], "rotation": 270, "texture": "#0"}, + "down": {"uv": [0, 9, 10, 11], "rotation": 90, "texture": "#0"} + } + }, + { + "from": [3, 5, 3], + "to": [13, 5, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [6, 5, 2]}, + "faces": { + "up": {"uv": [5, 2, 15, 12], "texture": "#1"}, + "down": {"uv": [5, 2, 15, 12], "texture": "#missing"} + } + }, + { + "from": [8, 5, 11], + "to": [13, 8, 12], + "rotation": {"angle": 22.5, "axis": "x", "origin": [11, 6, 10]}, + "faces": { + "north": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "south": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "up": {"uv": [0, 3, 5, 4], "texture": "#1"}, + "down": {"uv": [0, 0, 5, 1], "texture": "#1"} + } + }, + { + "from": [8, 5, 9], + "to": [13, 8, 10], + "rotation": {"angle": 22.5, "axis": "x", "origin": [11, 6, 8]}, + "faces": { + "north": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "south": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "up": {"uv": [0, 3, 5, 4], "texture": "#1"}, + "down": {"uv": [0, 0, 5, 1], "texture": "#1"} + } + }, + { + "from": [8, 5, 7], + "to": [13, 8, 8], + "rotation": {"angle": 22.5, "axis": "x", "origin": [11, 6, 6]}, + "faces": { + "north": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "south": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "up": {"uv": [0, 3, 5, 4], "texture": "#1"}, + "down": {"uv": [0, 0, 5, 1], "texture": "#1"} + } + }, + { + "from": [8, 5, 5], + "to": [13, 8, 6], + "rotation": {"angle": 22.5, "axis": "x", "origin": [11, 6, 4]}, + "faces": { + "north": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "east": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "south": {"uv": [0, 0, 5, 3], "texture": "#1"}, + "west": {"uv": [0, 0, 1, 3], "texture": "#1"}, + "up": {"uv": [0, 3, 5, 4], "texture": "#1"}, + "down": {"uv": [0, 0, 5, 1], "texture": "#1"} + } + }, + { + "from": [3, 5, 7], + "to": [7, 6, 13], + "rotation": {"angle": 0, "axis": "y", "origin": [3, 5, 8]}, + "faces": { + "north": {"uv": [0, 10, 4, 11], "texture": "#1"}, + "east": {"uv": [0, 11, 6, 12], "texture": "#1"}, + "south": {"uv": [0, 12, 4, 13], "texture": "#1"}, + "west": {"uv": [0, 13, 6, 14], "texture": "#1"}, + "up": {"uv": [0, 4, 4, 10], "texture": "#1"} + } + }, + { + "from": [3, 5, 5], + "to": [6, 7, 7], + "rotation": {"angle": 22.5, "axis": "y", "origin": [3, 5, 5]}, + "faces": { + "north": {"uv": [8, 0, 5, 2], "texture": "#1"}, + "east": {"uv": [8, 0, 10, 2], "texture": "#1"}, + "south": {"uv": [8, 0, 11, 2], "texture": "#1"}, + "west": {"uv": [8, 0, 10, 2], "texture": "#1"}, + "up": {"uv": [5, 0, 8, 2], "texture": "#1"} + } + }, + { + "from": [6, 5, 3], + "to": [8, 7, 6], + "rotation": {"angle": 22.5, "axis": "z", "origin": [8, 6, 3]}, + "faces": { + "north": {"uv": [8, 0, 10, 2], "texture": "#1"}, + "east": {"uv": [5, 0, 8, 2], "texture": "#1"}, + "south": {"uv": [8, 0, 10, 2], "texture": "#1"}, + "west": {"uv": [5, 0, 8, 2], "texture": "#1"}, + "up": {"uv": [8, 0, 5, 2], "rotation": 90, "texture": "#1"}, + "down": {"uv": [8, 0, 11, 2], "rotation": 270, "texture": "#1"} + } + } + ], + "display": {}, + "groups": [ + { + "name": "bowl", + "origin": [11, 2, 7], + "color": 0, + "children": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12] + }, + { + "name": "group", + "origin": [8, 8, 8], + "color": 0, + "children": [13, 14, 15, 16, 17, 18, 19, 20] + } + ] +} \ No newline at end of file diff --git a/src/main/resources/assets/lingshi/textures/block/bowl.png b/src/main/resources/assets/lingshi/textures/block/bowl.png new file mode 100644 index 0000000000000000000000000000000000000000..20c44620924ead992cdcd0a451e502b2d68573ad GIT binary patch literal 320 zcmV-G0l)rA!r?%KxMp@mL@f`f`K4uas|H|;lZauECgimu(H(15XAb9YG{!o}8HN?d%l z?YYf{Afd`9HsDmY=2(my6Uf9m`ti zjr<#6kvg8x&YvC5OZ^O(A9w2 zU>oOb6_6^J=;I#gD|>Pq(N|?dxJ_<<#uS&wYO~VS2*V`ib#BA=Y(d;#^*eo}$Co^O zMgXN6tJuL>_xBF2Ppcog%)-f&QB_p7RbT0XVG`HEHce}E_K?$?@0000A#8FxN$f?Myi51bN_8SQm?iR1!f(KUR*Sf^E8D5X|VNpw_?8l?dBSU|p6K z483Rt?M8NGkjw}Ziwp^N6r9bHMJi?&;*kye4|?z3m+$A{^L>P;$HX>()n*5vQLA$3 z<}~~5&uMM6$Tz0|kY$CT^A7~JjKylRb7tB{bL}et9}7(YK36A^Wd%ybt(nb$My<;G z)F<;$|5Zb|7@}+#2&&4DT(a|Ur;|$MUOVyX8H%pqa(R#>Nw5H{zD;eSmJI`ks*=kk zDdr0(x`snlDH{e}pP#Z}P&SMXc*jo%*~u2;Hx`MP=9zUzg@yETn=~l8hN5c}^92*0 zNiU=5nz@VHUfyS7CQjz;B@XTy0l@3?bNG}S**OGY2INE#ug{O12=*KRym)k(@qm@C z2}zPR*$$-wZBIP_KrWXAZ=?svuCH)l&sBtT*J!+X@=x1;?%tskj^J{60LWfA(raKn zv5(m5Lz>@~`i4(mkFoK1q1ONq!*g(a3~}ULlSV?lY~ZT1I)Ukrbye= lAd0RbCxWJju7m#re*rv+tmID5sOA6w002ovPDHLkV1k&A{LTOX literal 0 HcmV?d00001 diff --git a/src/main/resources/assets/lingshi/textures/item/pork_feet_rice.png b/src/main/resources/assets/lingshi/textures/item/pork_feet_rice.png new file mode 100644 index 0000000000000000000000000000000000000000..81997fe72cffb4616a093a11548cb4222f1f4e82 GIT binary patch literal 390 zcmV;10eSw3P)z;`?6``+jK&U>J{wZA(guF_!x z-s;2E?_=`fh^cf~tT?uHt^Ly9!cNOqN-5-s$f(<@hp28-n`^cQIKUB z)7uCS&w64Xer#q*ycT|RnhgSOqo~%Z0LZeQ=yjTW`U#6;oK!N&&ekf5Qm?<4YBT_v z5PdG0OkO2hsuB!X+Y%og>}dizW-v1*i$#y2&Dc;TuM$sHn$z0=05)^|CuW^}SS<#P k5zv@B0$M>0wHmufzekUIyJfY>-2eap07*qoM6N<$f~!WQ!vFvP literal 0 HcmV?d00001 diff --git a/src/main/resources/data/lingshi/loot_table/blocks/pork_feet_rice.json b/src/main/resources/data/lingshi/loot_table/blocks/pork_feet_rice.json new file mode 100644 index 0000000..773795b --- /dev/null +++ b/src/main/resources/data/lingshi/loot_table/blocks/pork_feet_rice.json @@ -0,0 +1,36 @@ +{ + "type": "minecraft:block", + "pools": [ + { + "rolls": 1, + "entries": [ + { + "type": "minecraft:item", + "name": "lingshi:pork_feet_rice", + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "lingshi:pork_feet_rice", + "properties": { + "amount": "1" + } + } + ] + }, + { + "type": "minecraft:item", + "name": "minecraft:bowl", + "conditions": [ + { + "condition": "minecraft:block_state_property", + "block": "lingshi:pork_feet_rice", + "properties": { + "amount": "0" + } + } + ] + } + ] + } + ] +}