Issue #4343 Axe can replant Cocoa (#4373)

This commit is contained in:
Enderaoe 2021-01-07 02:24:16 +08:00 committed by GitHub
parent ba7b6826b4
commit 3cd09b886f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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;
}