diff options
author | KHobbits <rob@khobbits.co.uk> | 2012-08-19 15:54:12 +0100 |
---|---|---|
committer | KHobbits <rob@khobbits.co.uk> | 2012-08-19 16:08:36 +0100 |
commit | e359e8ab6e577d050631771fec0e9685ca70fd4c (patch) | |
tree | db0727e7179469c49a77a85b2a49aa0cf6722108 /EssentialsAntiBuild | |
parent | 2f8f3aaa8d9eaa60924a1847c6d8559a2daa9ba4 (diff) | |
download | Essentials-e359e8ab6e577d050631771fec0e9685ca70fd4c.tar Essentials-e359e8ab6e577d050631771fec0e9685ca70fd4c.tar.gz Essentials-e359e8ab6e577d050631771fec0e9685ca70fd4c.tar.lz Essentials-e359e8ab6e577d050631771fec0e9685ca70fd4c.tar.xz Essentials-e359e8ab6e577d050631771fec0e9685ca70fd4c.zip |
Correct antibuild perm check
(still need to abort interact/use checks on block place)
Diffstat (limited to 'EssentialsAntiBuild')
-rw-r--r-- | EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java index 28e6797ac..8832ee630 100644 --- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java +++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java @@ -36,7 +36,7 @@ public class EssentialsAntiBuildListener implements Listener private boolean metaPermCheck(User user, String action, int blockId, byte data) { - String blockPerm = "essentials.build." + action + blockId; + String blockPerm = "essentials.build." + action + "." + blockId; String dataPerm = blockPerm + ":" + data; if (user.isAuthorized(dataPerm)) @@ -66,7 +66,7 @@ public class EssentialsAntiBuildListener implements Listener final User user = ess.getUser(event.getPlayer()); if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build") - && metaPermCheck(user, "place", event.getBlock())) + && !metaPermCheck(user, "place", event.getBlock())) { event.setCancelled(true); return; @@ -98,7 +98,7 @@ public class EssentialsAntiBuildListener implements Listener final User user = ess.getUser(event.getPlayer()); if (prot.getSettingBool(AntiBuildConfig.disable_build) && !user.canBuild() && !user.isAuthorized("essentials.build") - && metaPermCheck(user, "break", event.getBlock())) + && !metaPermCheck(user, "break", event.getBlock())) { event.setCancelled(true); return; @@ -191,7 +191,7 @@ public class EssentialsAntiBuildListener implements Listener if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.interact") && !user.isAuthorized("essentials.build")) { - if (metaPermCheck(user, "interact", event.getClickedBlock())) + if (!metaPermCheck(user, "interact", event.getClickedBlock())) { event.setUseInteractedBlock(Result.DENY); if (ess.getSettings().warnOnBuildDisallow()) @@ -199,7 +199,7 @@ public class EssentialsAntiBuildListener implements Listener user.sendMessage(_("buildAlert")); } } - if (event.hasItem() && metaPermCheck(user, "interact", event.getItem().getTypeId(), event.getItem().getData().getData())) + if (event.hasItem() && !metaPermCheck(user, "use", event.getItem().getTypeId(), event.getItem().getData().getData())) { event.setUseItemInHand(Result.DENY); } |