Green Thumb (Plants) now fires a SubSkillBlockEvent

This commit is contained in:
nossr50
2021-02-03 15:08:21 -08:00
parent 1c1abe9a2a
commit 369b34406e
2 changed files with 12 additions and 5 deletions

View File

@ -754,11 +754,16 @@ public class HerbalismManager extends SkillManager {
return false;
}
playerInventory.removeItem(seedStack);
player.updateInventory(); // Needed until replacement available
//Play sound
SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_CONSUMED);
return true;
if(EventUtils.callSubSkillBlockEvent(player, SubSkillType.HERBALISM_GREEN_THUMB, blockState.getBlock()).isCancelled()) {
return false;
} else {
playerInventory.removeItem(seedStack);
player.updateInventory(); // Needed until replacement available
//Play sound
SoundManager.sendSound(player, player.getLocation(), SoundType.ITEM_CONSUMED);
return true;
}
// new HerbalismBlockUpdaterTask(blockState).runTaskLater(mcMMO.p, 0);
}