Fix sneak check on GT

This commit is contained in:
nossr50 2020-02-19 16:19:19 -08:00
parent 7c6d5c476d
commit a333f36fd8

View File

@ -171,7 +171,8 @@ public class HerbalismManager extends SkillManager {
//TODO: The design of Green Terra needs to change, this is a mess
if(Permissions.greenThumbPlant(getPlayer(), originalBreak.getType())) {
processGreenThumbPlants(originalBreak, blockBreakEvent, isGreenTerraActive());
if(!getPlayer().isSneaking())
processGreenThumbPlants(originalBreak, blockBreakEvent, isGreenTerraActive());
}
//When replanting a immature crop we cancel the block break event and back out
@ -669,7 +670,7 @@ public class HerbalismManager extends SkillManager {
* @param greenTerra boolean to determine if greenTerra is active or not
*/
private void processGreenThumbPlants(BlockState blockState, BlockBreakEvent blockBreakEvent, boolean greenTerra) {
if(blockBreakEvent.getPlayer().isSneaking() || !ItemUtils.isHoe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand())) {
if(!ItemUtils.isHoe(blockBreakEvent.getPlayer().getInventory().getItemInMainHand())) {
return;
}