Add ability for plugins to prevent sitting on chairs
This commit is contained in:
@@ -42,6 +42,7 @@ public class AnuraCore extends JavaPlugin {
|
|||||||
public HashMap<Player, Boolean> disableCommandsAdventure = new HashMap<>();
|
public HashMap<Player, Boolean> disableCommandsAdventure = new HashMap<>();
|
||||||
public HashMap<Player, Integer> joinTime = new HashMap<>();
|
public HashMap<Player, Integer> joinTime = new HashMap<>();
|
||||||
public HashMap<Player, Integer> aimTheWaterWins = new HashMap<>();
|
public HashMap<Player, Integer> aimTheWaterWins = new HashMap<>();
|
||||||
|
public ArrayList<Player> denySit = new ArrayList<>();
|
||||||
public Features features;
|
public Features features;
|
||||||
public Permissions perms;
|
public Permissions perms;
|
||||||
public Signs signs;
|
public Signs signs;
|
||||||
|
|||||||
@@ -93,7 +93,7 @@ public class PlayerInteract implements Listener {
|
|||||||
event.setCancelled(true);
|
event.setCancelled(true);
|
||||||
}
|
}
|
||||||
} else if (block.getState().getData() instanceof Stairs) {
|
} 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);
|
event.setCancelled(true);
|
||||||
if (plugin.sittableBlocks.contains(block)) {
|
if (plugin.sittableBlocks.contains(block)) {
|
||||||
plugin.sittableBlocks.remove(block);
|
plugin.sittableBlocks.remove(block);
|
||||||
|
|||||||
Reference in New Issue
Block a user