From 3cd09b886fe6c28280a1dd9ae9b2ce52bc0b2170 Mon Sep 17 00:00:00 2001 From: Enderaoe Date: Thu, 7 Jan 2021 02:24:16 +0800 Subject: [PATCH] Issue #4343 Axe can replant Cocoa (#4373) --- .../gmail/nossr50/skills/herbalism/HerbalismManager.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java index 72fc0e1bb..d1d920359 100644 --- a/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java +++ b/src/main/java/com/gmail/nossr50/skills/herbalism/HerbalismManager.java @@ -687,7 +687,8 @@ public class HerbalismManager extends SkillManager { * @param greenTerra boolean to determine if greenTerra is active or not */ private boolean processGreenThumbPlants(BlockState blockState, BlockBreakEvent blockBreakEvent, boolean greenTerra) { - if(!ItemUtils.isHoe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand())) { + if (!ItemUtils.isHoe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand()) + && !ItemUtils.isAxe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand())) { return false; } @@ -736,6 +737,11 @@ public class HerbalismManager extends SkillManager { ItemStack seedStack = new ItemStack(seed); + if (ItemUtils.isAxe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand()) + && blockState.getType() != Material.COCOA) { + return false; + } + if (!greenTerra && !RandomChanceUtil.checkRandomChanceExecutionSuccess(player, SubSkillType.HERBALISM_GREEN_THUMB, true)) { return false; }