Add ability for plugins to prevent sitting on chairs

This commit is contained in:
kaenganxt
2014-12-22 18:52:51 +01:00
parent cb300ec53f
commit 9406f426fa
2 changed files with 2 additions and 1 deletions

View File

@@ -42,6 +42,7 @@ public class AnuraCore extends JavaPlugin {
public HashMap<Player, Boolean> disableCommandsAdventure = new HashMap<>();
public HashMap<Player, Integer> joinTime = new HashMap<>();
public HashMap<Player, Integer> aimTheWaterWins = new HashMap<>();
public ArrayList<Player> denySit = new ArrayList<>();
public Features features;
public Permissions perms;
public Signs signs;

View File

@@ -93,7 +93,7 @@ public class PlayerInteract implements Listener {
event.setCancelled(true);
}
} else if (block.getState().getData() instanceof Stairs) {
if (plugin.stairMode.contains(event.getPlayer()) && event.getAction().equals(Action.RIGHT_CLICK_BLOCK)) {
if (plugin.stairMode.contains(event.getPlayer()) && event.getAction().equals(Action.RIGHT_CLICK_BLOCK) && plugin.denySit.contains(event.getPlayer())) {
event.setCancelled(true);
if (plugin.sittableBlocks.contains(block)) {
plugin.sittableBlocks.remove(block);