From 830e3d873520fff11f1608d2bfe63377d571df2b Mon Sep 17 00:00:00 2001 From: EERussianguy Date: Sat, 23 Sep 2023 17:02:22 -0400 Subject: [PATCH] fix dupe with drying mats, make firmalife bushes mineable with a scythe --- resources/data.py | 2 +- .../common/blockentities/DryingMatBlockEntity.java | 7 ++++++- .../data/tfc/tags/blocks/mineable_with_sharp_tool.json | 4 +++- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/resources/data.py b/resources/data.py index aafb4119..b2e7f86a 100644 --- a/resources/data.py +++ b/resources/data.py @@ -88,7 +88,7 @@ def generate(rm: ResourceManager): rm.block_tag('drops_ice_shavings', 'minecraft:ice') rm.block_tag('minecraft:mineable/axe', *['firmalife:plant/%s_branch' % t for t in FRUITS], *['firmalife:plant/%s_growing_branch' % t for t in FRUITS]) - rm.block_tag('tfc:mineable_with_sharp_tool', *['firmalife:plant/%s_leaves' % t for t in FRUITS], *['firmalife:plant/%s_sapling' % t for t in FRUITS]) + rm.block_tag('tfc:mineable_with_sharp_tool', *['firmalife:plant/%s_leaves' % t for t in FRUITS], *['firmalife:plant/%s_sapling' % t for t in FRUITS], *['firmalife:plant/%s_bush' % b for b in STILL_BUSHES.keys()]) rm.block_tag('tfc:replaceable_plants', *['firmalife:plant/%s' % p for p in HERBS], 'firmalife:plant/butterfly_grass') rm.entity_tag('drops_rennet', 'tfc:goat', 'tfc:yak') diff --git a/src/main/java/com/eerussianguy/firmalife/common/blockentities/DryingMatBlockEntity.java b/src/main/java/com/eerussianguy/firmalife/common/blockentities/DryingMatBlockEntity.java index b918e554..158f178c 100644 --- a/src/main/java/com/eerussianguy/firmalife/common/blockentities/DryingMatBlockEntity.java +++ b/src/main/java/com/eerussianguy/firmalife/common/blockentities/DryingMatBlockEntity.java @@ -41,7 +41,12 @@ public static void serverTick(Level level, BlockPos pos, BlockState state, Dryin if (mat.cachedRecipe != null) { - if (mat.getTicksLeft() <= 0) + if (!mat.cachedRecipe.matches(new ItemStackInventory(mat.inventory.getStackInSlot(0)), level)) + { + mat.cachedRecipe = null; + mat.resetCounter(); + } + else if (mat.getTicksLeft() <= 0) { mat.finish(); } diff --git a/src/main/resources/data/tfc/tags/blocks/mineable_with_sharp_tool.json b/src/main/resources/data/tfc/tags/blocks/mineable_with_sharp_tool.json index 1426b544..3c9f2ba2 100644 --- a/src/main/resources/data/tfc/tags/blocks/mineable_with_sharp_tool.json +++ b/src/main/resources/data/tfc/tags/blocks/mineable_with_sharp_tool.json @@ -23,6 +23,8 @@ "firmalife:plant/cocoa_leaves", "firmalife:plant/fig_leaves", "firmalife:plant/cocoa_sapling", - "firmalife:plant/fig_sapling" + "firmalife:plant/fig_sapling", + "firmalife:plant/nightshade_bush", + "firmalife:plant/pineapple_bush" ] } \ No newline at end of file