mirror of
https://github.com/mcMMO-Dev/mcMMO.git
synced 2025-07-05 23:24:44 +02:00
Require sneaking to activate abilities if the player is holding an item on the offhand.
This commit is contained in:
@ -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()) {
|
||||||
|
Reference in New Issue
Block a user