Skip to content

Commit 783a230

Browse files
committed
Fix farming for crops that have the harvest tool type of axe
1 parent 4599082 commit 783a230

File tree

1 file changed

+7
-5
lines changed

1 file changed

+7
-5
lines changed

src/main/java/com/willr27/blocklings/util/ToolUtil.java

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -438,15 +438,16 @@ public static float getToolEnchantmentHarvestSpeed(@Nonnull ItemStack stack)
438438
*/
439439
public static boolean canToolHarvest(@Nonnull ItemStack stack, @Nonnull BlockState blockState)
440440
{
441-
if (BlockUtil.isOre(blockState.getBlock()) && !ToolUtil.isPickaxe(stack))
441+
if (BlockUtil.isCrop(blockState.getBlock()) && ToolUtil.isHoe(stack))
442442
{
443-
return false;
443+
return true;
444444
}
445-
else if (BlockUtil.isLog(blockState.getBlock()) && !ToolUtil.isAxe(stack))
445+
446+
if (BlockUtil.isOre(blockState.getBlock()) && !ToolUtil.isPickaxe(stack))
446447
{
447448
return false;
448449
}
449-
else if (BlockUtil.isCrop(blockState.getBlock()) && !ToolUtil.isHoe(stack))
450+
else if (BlockUtil.isLog(blockState.getBlock()) && !ToolUtil.isAxe(stack))
450451
{
451452
return false;
452453
}
@@ -463,7 +464,8 @@ else if (BlockUtil.isCrop(blockState.getBlock()) && !ToolUtil.isHoe(stack))
463464
{
464465
return true;
465466
}
466-
else {
467+
else
468+
{
467469
for (ToolType toolType : stack.getToolTypes())
468470
{
469471
if (toolType == harvestTool)

0 commit comments

Comments
 (0)