Add ignore-if-block-in-hand option.
This commit is contained in:
@@ -24,7 +24,7 @@ public class Chairs extends JavaPlugin {
|
||||
public List<ChairBlock> allowedBlocks = new ArrayList<ChairBlock>();
|
||||
public List<Material> validSigns = new ArrayList<Material>();
|
||||
public boolean sneaking, autoRotate, signCheck, permissions, notifyplayer, opsOverridePerms;
|
||||
public boolean invertedStairCheck, seatOccupiedCheck, invertedStepCheck, perItemPerms;
|
||||
public boolean invertedStairCheck, seatOccupiedCheck, invertedStepCheck, perItemPerms, ignoreIfBlockInHand;
|
||||
public boolean sitEffectsEnabled;
|
||||
public double sittingHeight, sittingHeightAdj, distance;
|
||||
public int maxChairWidth;
|
||||
@@ -109,6 +109,7 @@ public class Chairs extends JavaPlugin {
|
||||
invertedStepCheck = getConfig().getBoolean("upper-step-check");
|
||||
perItemPerms = getConfig().getBoolean("per-item-perms");
|
||||
opsOverridePerms = getConfig().getBoolean("ops-override-perms");
|
||||
ignoreIfBlockInHand = getConfig().getBoolean("ignore-if-block-in-hand");
|
||||
|
||||
sitEffectsEnabled = getConfig().getBoolean("sit-effects.enabled", false);
|
||||
sitEffectInterval = getConfig().getInt("sit-effects.interval",20);
|
||||
|
@@ -108,6 +108,10 @@ public class EventListener implements Listener {
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerInteract(PlayerInteractEvent event) {
|
||||
if (event.getPlayer().getItemInHand().getType().isBlock()
|
||||
&& plugin.ignoreIfBlockInHand) {
|
||||
return;
|
||||
}
|
||||
if (event.hasBlock() && event.getAction() == Action.RIGHT_CLICK_BLOCK) {
|
||||
|
||||
Block block = event.getClickedBlock();
|
||||
|
Reference in New Issue
Block a user