summaryrefslogtreecommitdiffstats
path: root/EssentialsAntiBuild
diff options
context:
space:
mode:
authorKHobbits <rob@khobbits.co.uk>2012-09-24 12:48:07 +0100
committerKHobbits <rob@khobbits.co.uk>2012-09-24 12:48:07 +0100
commit22d1db5463a09817e547eafe50d2880b0a6a2ce3 (patch)
tree016aec0a16c325da80f3c1cb92c4cf8388ce0de0 /EssentialsAntiBuild
parentf2b4bb00b69d91e2c9f1fe4ee38ae89a43197c74 (diff)
downloadEssentials-22d1db5463a09817e547eafe50d2880b0a6a2ce3.tar
Essentials-22d1db5463a09817e547eafe50d2880b0a6a2ce3.tar.gz
Essentials-22d1db5463a09817e547eafe50d2880b0a6a2ce3.tar.lz
Essentials-22d1db5463a09817e547eafe50d2880b0a6a2ce3.tar.xz
Essentials-22d1db5463a09817e547eafe50d2880b0a6a2ce3.zip
Envelope new drop/pickup/craft perms under 'essentials.build'.
Diffstat (limited to 'EssentialsAntiBuild')
-rw-r--r--EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java35
1 files changed, 21 insertions, 14 deletions
diff --git a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
index e57ba8864..d2f46586f 100644
--- a/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
+++ b/EssentialsAntiBuild/src/com/earth2me/essentials/antibuild/EssentialsAntiBuildListener.java
@@ -245,12 +245,15 @@ public class EssentialsAntiBuildListener implements Listener
final User user = ess.getUser(entity);
final ItemStack item = event.getRecipe().getResult();
- if (!metaPermCheck(user, "craft", item.getTypeId(), item.getData().getData()))
+ if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- event.setCancelled(true);
- if (ess.getSettings().warnOnBuildDisallow())
+ if (!metaPermCheck(user, "craft", item.getTypeId(), item.getData().getData()))
{
- user.sendMessage(_("antiBuildCraft", item.getType().toString()));
+ event.setCancelled(true);
+ if (ess.getSettings().warnOnBuildDisallow())
+ {
+ user.sendMessage(_("antiBuildCraft", item.getType().toString()));
+ }
}
}
}
@@ -263,12 +266,14 @@ public class EssentialsAntiBuildListener implements Listener
final User user = ess.getUser(event.getPlayer());
final ItemStack item = event.getItem().getItemStack();
- if (!metaPermCheck(user, "pickup", item.getTypeId(), item.getData().getData()))
+ if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- event.setCancelled(true);
- event.getItem().setPickupDelay(50);
+ if (!metaPermCheck(user, "pickup", item.getTypeId(), item.getData().getData()))
+ {
+ event.setCancelled(true);
+ event.getItem().setPickupDelay(50);
+ }
}
-
}
@EventHandler(priority = EventPriority.LOW, ignoreCancelled = true)
@@ -278,15 +283,17 @@ public class EssentialsAntiBuildListener implements Listener
final User user = ess.getUser(event.getPlayer());
final ItemStack item = event.getItemDrop().getItemStack();
- if (!metaPermCheck(user, "drop", item.getTypeId(), item.getData().getData()))
+ if (prot.getSettingBool(AntiBuildConfig.disable_use) && !user.canBuild() && !user.isAuthorized("essentials.build"))
{
- event.setCancelled(true);
- user.updateInventory();
- if (ess.getSettings().warnOnBuildDisallow())
+ if (!metaPermCheck(user, "drop", item.getTypeId(), item.getData().getData()))
{
- user.sendMessage(_("antiBuildDrop", item.getType().toString()));
+ event.setCancelled(true);
+ user.updateInventory();
+ if (ess.getSettings().warnOnBuildDisallow())
+ {
+ user.sendMessage(_("antiBuildDrop", item.getType().toString()));
+ }
}
}
-
}
}