mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-11-30 00:56:47 +01:00
Fix infinite GreenThumb & ShroomThumb usage bug
This commit is contained in:
parent
28a2b9668d
commit
bddca30668
@ -50,13 +50,21 @@ public class HerbalismManager extends SkillManager {
|
|||||||
|
|
||||||
public boolean canGreenThumbBlock(BlockState blockState) {
|
public boolean canGreenThumbBlock(BlockState blockState) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
|
|
||||||
return player.getItemInHand().getType() == Material.SEEDS && BlockUtils.canMakeMossy(blockState) && Permissions.greenThumbBlock(player, blockState.getType());
|
if (item.getAmount() <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
return item.getType() == Material.SEEDS && BlockUtils.canMakeMossy(blockState) && Permissions.greenThumbBlock(player, blockState.getType());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canUseShroomThumb(BlockState blockState) {
|
public boolean canUseShroomThumb(BlockState blockState) {
|
||||||
Player player = getPlayer();
|
Player player = getPlayer();
|
||||||
Material itemType = player.getItemInHand().getType();
|
ItemStack item = player.getInventory().getItemInMainHand();
|
||||||
|
Material itemType = item.getType();
|
||||||
|
|
||||||
|
if (item.getAmount() <= 0)
|
||||||
|
return false;
|
||||||
|
|
||||||
return (itemType == Material.RED_MUSHROOM || itemType == Material.BROWN_MUSHROOM) && BlockUtils.canMakeShroomy(blockState) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHROOM_THUMB);
|
return (itemType == Material.RED_MUSHROOM || itemType == Material.BROWN_MUSHROOM) && BlockUtils.canMakeShroomy(blockState) && Permissions.secondaryAbilityEnabled(player, SecondaryAbility.SHROOM_THUMB);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user