From 5fdc7432100ad32371e1a142b8232b9d4e955919 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?L=C3=A9a=20Gris?= Date: Mon, 26 Mar 2012 08:47:24 +0200 Subject: [PATCH] New permission node: permissions.interact: description: Allows player to interact when build is false. default: false --- .../java/com/platymuus/bukkit/permissions/PlayerListener.java | 4 ++-- src/main/resources/plugin.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/platymuus/bukkit/permissions/PlayerListener.java b/src/main/java/com/platymuus/bukkit/permissions/PlayerListener.java index 6de5d21..9b3a951 100644 --- a/src/main/java/com/platymuus/bukkit/permissions/PlayerListener.java +++ b/src/main/java/com/platymuus/bukkit/permissions/PlayerListener.java @@ -48,7 +48,7 @@ public void onPlayerQuit(PlayerQuitEvent event) { plugin.unregisterPlayer(event.getPlayer()); } - // Prevent doing things in the event of permissions.build: false + // Prevent doing things in the event of permissions.build: false and permissions.interact: false @EventHandler public void onPlayerInteract(PlayerInteractEvent event) { @@ -56,7 +56,7 @@ public void onPlayerInteract(PlayerInteractEvent event) { if (event.getAction() == Action.LEFT_CLICK_AIR || event.getAction() == Action.RIGHT_CLICK_AIR) { return; } - if (!event.getPlayer().hasPermission("permissions.build")) { + if (!event.getPlayer().hasPermission("permissions.build")&&!event.getPlayer().hasPermission("permissions.interact")) { bother(event.getPlayer()); event.setCancelled(true); } diff --git a/src/main/resources/plugin.yml b/src/main/resources/plugin.yml index 4ebe00f..6a33e80 100644 --- a/src/main/resources/plugin.yml +++ b/src/main/resources/plugin.yml @@ -44,6 +44,9 @@ permissions: permissions.build: description: Allows player to build. default: true + permissions.interact: + description: Allows player to interact when build is false. + default: false permissions.help: description: Allows viewing of usage for /permissions. permissions.reload: