diff --git a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 index ce7d3e1..96c0a97 100644 --- a/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 +++ b/src/generated/resources/.cache/71e72dbdeb626cc835aaccd2ae47fd3d8794cd24 @@ -1,4 +1,4 @@ -// 1.21 2024-08-29T07:08:37.9053494 Item Models: lingshi +// 1.21 2024-08-30T00:38:36.78528 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 @@ -9,6 +9,7 @@ bad0cb5e093fa42331c2d4a1157d1a7b5b3fc588 assets/lingshi/models/item/chopping_boa 249957a6811e300efca306db358e468855851d73 assets/lingshi/models/item/iron_knife.json 8889a4deb394774a900a518a3d4849db21da3370 assets/lingshi/models/item/noodles.json b767fc7952daf0eff3485fe4d8c06c5bba930c22 assets/lingshi/models/item/oil_bucket.json +8a787e79ccb05e02b90ea12cfed0a54b8fda4bf5 assets/lingshi/models/item/pig_feet.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 0b7344c..fa30bd5 100644 --- a/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 +++ b/src/generated/resources/.cache/85f12f813aff948f91f5cd129c0ffa86bcb17361 @@ -1,2 +1,2 @@ -// 1.21 2024-08-29T05:56:03.5935269 Languages: zh_cn for mod: lingshi -5bdd11351b0d44fe7080a6d7c35de0b93b2adbf4 assets/lingshi/lang/zh_cn.json +// 1.21 2024-08-30T00:17:04.375195 Languages: zh_cn for mod: lingshi +12b7b8f4abc406cbe0975e45310e1a78e62f7caa assets/lingshi/lang/zh_cn.json diff --git a/src/generated/resources/assets/lingshi/lang/zh_cn.json b/src/generated/resources/assets/lingshi/lang/zh_cn.json index 5f8edc2..6c8e2df 100644 --- a/src/generated/resources/assets/lingshi/lang/zh_cn.json +++ b/src/generated/resources/assets/lingshi/lang/zh_cn.json @@ -16,6 +16,7 @@ "item.lingshi.iron_knife": "铁菜刀", "item.lingshi.noodles": "面条", "item.lingshi.oil_bucket": "油桶", + "item.lingshi.pig_feet": "猪蹄", "item.lingshi.pot_lid": "锅盖", "item.lingshi.rice_of_ear": "稻穗", "item.lingshi.spatula": "锅铲", diff --git a/src/generated/resources/assets/lingshi/models/item/pig_feet.json b/src/generated/resources/assets/lingshi/models/item/pig_feet.json new file mode 100644 index 0000000..81a39b9 --- /dev/null +++ b/src/generated/resources/assets/lingshi/models/item/pig_feet.json @@ -0,0 +1,6 @@ +{ + "parent": "minecraft:item/generated", + "textures": { + "layer0": "lingshi:item/pig_feet" + } +} \ No newline at end of file diff --git a/src/main/java/mczme/lingshi/common/block/RiceSeedlingTopBlock.java b/src/main/java/mczme/lingshi/common/block/RiceSeedlingTopBlock.java index 32c6170..9a84811 100644 --- a/src/main/java/mczme/lingshi/common/block/RiceSeedlingTopBlock.java +++ b/src/main/java/mczme/lingshi/common/block/RiceSeedlingTopBlock.java @@ -19,6 +19,7 @@ import net.minecraft.world.phys.shapes.CollisionContext; import net.minecraft.world.phys.shapes.VoxelShape; +import static mczme.lingshi.common.block.RiceSeedlingBlock.EMERGE; import static mczme.lingshi.common.block.RiceSeedlingBlock.WATERLOGGED; public class RiceSeedlingTopBlock extends CropBlock { @@ -53,7 +54,7 @@ public void performBonemeal(ServerLevel pLevel, RandomSource pRandom, BlockPos p } pLevel.setBlock(pPos, this.getStateForAge(i), 2); if (i == 4) { - pLevel.setBlockAndUpdate(pPos.below(), pLevel.getBlockState(pPos.below()).setValue(WATERLOGGED, false)); + pLevel.setBlockAndUpdate(pPos.below(), pLevel.getBlockState(pPos.below()).setValue(WATERLOGGED, false).setValue(EMERGE,true)); } } diff --git a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java index effc3b3..be0bbd8 100644 --- a/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java +++ b/src/main/java/mczme/lingshi/common/data/CookingFoodDataGen.java @@ -27,7 +27,7 @@ protected CookingFoodDataGen(PackOutput packOutput, CompletableFuture( - CookingDataClientPayloadHandler::handleData, - CookingDataServerPayloadHandler::handleData - ) - ); + } } diff --git a/src/main/java/mczme/lingshi/common/network/CookingData.java b/src/main/java/mczme/lingshi/common/network/CookingData.java deleted file mode 100644 index 8708a35..0000000 --- a/src/main/java/mczme/lingshi/common/network/CookingData.java +++ /dev/null @@ -1,25 +0,0 @@ -package mczme.lingshi.common.network; - -import mczme.lingshi.lingshi; -import net.minecraft.core.BlockPos; -import net.minecraft.network.RegistryFriendlyByteBuf; -import net.minecraft.network.codec.StreamCodec; -import net.minecraft.network.protocol.common.custom.CustomPacketPayload; -import net.minecraft.resources.ResourceLocation; -import net.minecraft.world.item.ItemStack; -import org.jetbrains.annotations.NotNull; - -public record CookingData(BlockPos pPos, ItemStack result) implements CustomPacketPayload { - - public static final CustomPacketPayload.Type TYPE = new CustomPacketPayload.Type<>(ResourceLocation.fromNamespaceAndPath(lingshi.MODID, "skillet_cooking_data")); - - public static final StreamCodec STREAM_CODEC = StreamCodec.composite( - BlockPos.STREAM_CODEC, CookingData::pPos, - ItemStack.OPTIONAL_STREAM_CODEC,CookingData::result, - CookingData::new); - - @Override - public @NotNull Type type() { - return TYPE; - } -} diff --git a/src/main/java/mczme/lingshi/common/network/CookingDataClientPayloadHandler.java b/src/main/java/mczme/lingshi/common/network/CookingDataClientPayloadHandler.java deleted file mode 100644 index 3a279ab..0000000 --- a/src/main/java/mczme/lingshi/common/network/CookingDataClientPayloadHandler.java +++ /dev/null @@ -1,32 +0,0 @@ -package mczme.lingshi.common.network; - -import net.minecraft.core.BlockPos; -import net.minecraft.network.chat.Component; -import net.minecraft.world.item.ItemStack; -import net.neoforged.neoforge.network.handling.IPayloadContext; - -public class CookingDataClientPayloadHandler { - - private static BlockPos blockPos; - private static ItemStack result; - - public static void handleData(final CookingData data, final IPayloadContext context) { - context.enqueueWork(() -> { - blockPos = data.pPos(); - result = data.result(); - }) - .exceptionally(e -> { - // Handle exception - context.disconnect(Component.translatable("lingshi.networking.failed", e.getMessage())); - return null; - }); - } - - public static BlockPos getBlockPos(){ - return blockPos; - } - - public static ItemStack getResult() { - return result; - } -} diff --git a/src/main/java/mczme/lingshi/common/network/CookingDataServerPayloadHandler.java b/src/main/java/mczme/lingshi/common/network/CookingDataServerPayloadHandler.java deleted file mode 100644 index a1f9186..0000000 --- a/src/main/java/mczme/lingshi/common/network/CookingDataServerPayloadHandler.java +++ /dev/null @@ -1,22 +0,0 @@ -package mczme.lingshi.common.network; - -import net.minecraft.network.chat.Component; -import net.neoforged.neoforge.network.handling.IPayloadContext; - -public class CookingDataServerPayloadHandler { - - public static void handleData(final CookingData data, final IPayloadContext context) { - // Do something with the data, on the network thread - - // Do something with the data, on the main thread - context.enqueueWork(() -> { - - }) - .exceptionally(e -> { - // Handle exception - context.disconnect(Component.translatable("lingshi.networking.failed", e.getMessage())); - return null; - }); - } - -} diff --git a/src/main/java/mczme/lingshi/common/registry/ModItems.java b/src/main/java/mczme/lingshi/common/registry/ModItems.java index a1ef39c..6e5a101 100644 --- a/src/main/java/mczme/lingshi/common/registry/ModItems.java +++ b/src/main/java/mczme/lingshi/common/registry/ModItems.java @@ -42,6 +42,7 @@ public class ModItems { public static final Supplier FLOUR = registerWithCreateTab("flour", () -> new Item(new Item.Properties())); 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()))); private static Supplier registerWithCreateTab(String item_name, Supplier itemSupplier) { Supplier item = ITEMS.register(item_name, itemSupplier); diff --git a/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png b/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png index 2a302d7..fc9766b 100644 Binary files a/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png and b/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png differ diff --git a/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png.mcmeta b/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png.mcmeta index 7183f86..74dc5e2 100644 --- a/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png.mcmeta +++ b/src/main/resources/assets/lingshi/textures/block/stove_top_fire.png.mcmeta @@ -1,6 +1,7 @@ { "animation": { "frametime": 15, + "interpolate": true, "frames": [0, 1, 2, 1] } } \ No newline at end of file diff --git a/src/main/resources/assets/lingshi/textures/item/noodles.png b/src/main/resources/assets/lingshi/textures/item/noodles.png index 14525fa..d0c8d6b 100644 Binary files a/src/main/resources/assets/lingshi/textures/item/noodles.png and b/src/main/resources/assets/lingshi/textures/item/noodles.png differ diff --git a/src/main/resources/assets/lingshi/textures/item/pig_feet.png b/src/main/resources/assets/lingshi/textures/item/pig_feet.png new file mode 100644 index 0000000..7322397 Binary files /dev/null and b/src/main/resources/assets/lingshi/textures/item/pig_feet.png differ diff --git a/src/main/resources/data/lingshi/loot_modifiers/add_item_pig_feet_to_pig.json b/src/main/resources/data/lingshi/loot_modifiers/add_item_pig_feet_to_pig.json new file mode 100644 index 0000000..8763c8a --- /dev/null +++ b/src/main/resources/data/lingshi/loot_modifiers/add_item_pig_feet_to_pig.json @@ -0,0 +1,21 @@ +{"type": "neoforge:add_table", + "conditions": [ + { + "condition": "minecraft:all_of", + "terms": [ + { + "condition": "minecraft:entity_properties", + "entity": "this", + "predicate": { + "type": "minecraft:pig" + } + }, + { + "condition": "minecraft:killed_by_player", + "inverse": true + } + ] + } + ], + "table": "lingshi:entities/pig_feet" +} \ No newline at end of file diff --git a/src/main/resources/data/lingshi/loot_table/entities/pig_feet.json b/src/main/resources/data/lingshi/loot_table/entities/pig_feet.json new file mode 100644 index 0000000..2d1404e --- /dev/null +++ b/src/main/resources/data/lingshi/loot_table/entities/pig_feet.json @@ -0,0 +1,32 @@ +{ + "type": "minecraft:entity", + "pools": [ + { + "rolls": { + "min": 1, + "max": 4 + }, + "bonus_rolls": 0, + "entries": [ + { + "type": "minecraft:item", + "name": "lingshi:pig_feet" + } + ], + "conditions": [ + { + "condition": "minecraft:entity_properties", + "entity": "attacking_player", + "predicate": { + "equipment": { + "mainhand": { + "items": "#neoforge:knife" + } + } + } + } + ] + } + ], + "random_sequence": "minecraft:entities/pig" +} diff --git a/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json b/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json new file mode 100644 index 0000000..a8a2cb5 --- /dev/null +++ b/src/main/resources/data/neoforge/loot_modifiers/global_loot_modifiers.json @@ -0,0 +1,6 @@ +{ + "replace": false, + "entries": [ + "lingshi:add_item_pig_feet_to_pig" + ] +} \ No newline at end of file