mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2024-12-01 17:36:46 +01:00
Require sneaking to activate abilities if the player is holding an item on the offhand.
This commit is contained in:
parent
28a2b9668d
commit
87056a2d96
@ -528,6 +528,10 @@ public class PlayerListener implements Listener {
|
|||||||
|
|
||||||
switch (event.getAction()) {
|
switch (event.getAction()) {
|
||||||
case RIGHT_CLICK_BLOCK:
|
case RIGHT_CLICK_BLOCK:
|
||||||
|
if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isSneaking()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
Block block = event.getClickedBlock();
|
Block block = event.getClickedBlock();
|
||||||
BlockState blockState = block.getState();
|
BlockState blockState = block.getState();
|
||||||
|
|
||||||
@ -569,6 +573,9 @@ public class PlayerListener implements Listener {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case RIGHT_CLICK_AIR:
|
case RIGHT_CLICK_AIR:
|
||||||
|
if(player.getInventory().getItemInOffHand().getType() != Material.AIR && !player.isSneaking()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/* ACTIVATION CHECKS */
|
/* ACTIVATION CHECKS */
|
||||||
if (Config.getInstance().getAbilitiesEnabled()) {
|
if (Config.getInstance().getAbilitiesEnabled()) {
|
||||||
|
Loading…
Reference in New Issue
Block a user