summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorementalo <suror@gmx.co.uk>2012-01-23 15:48:56 +0000
committerementalo <suror@gmx.co.uk>2012-01-23 15:48:56 +0000
commitf93769dd1dd11ef30c77dd6c9e0e5cf275052715 (patch)
tree8211c27b418e61f713604a41ce3a23875ebc7b00
parent4b61ac9043ff6088c4910d497e8ee18e13d5494b (diff)
downloadEssentials-f93769dd1dd11ef30c77dd6c9e0e5cf275052715.tar
Essentials-f93769dd1dd11ef30c77dd6c9e0e5cf275052715.tar.gz
Essentials-f93769dd1dd11ef30c77dd6c9e0e5cf275052715.tar.lz
Essentials-f93769dd1dd11ef30c77dd6c9e0e5cf275052715.tar.xz
Essentials-f93769dd1dd11ef30c77dd6c9e0e5cf275052715.zip
Add new permission essentials.protect.alerts.notrigger
If user has this permisson they do not trigger EssProtect block alerts
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java6
-rw-r--r--EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java1
2 files changed, 5 insertions, 2 deletions
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
index c193561db..8e5e9cca8 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectBlockListener.java
@@ -51,7 +51,8 @@ public class EssentialsProtectBlockListener implements Listener
return;
}
- if (prot.checkProtectionItems(ProtectConfig.alert_on_placement, id))
+ if (!user.hasPermission("essentials.protect.alerts.notrigger")
+ && prot.checkProtectionItems(ProtectConfig.alert_on_placement, id))
{
prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced"));
}
@@ -249,7 +250,8 @@ public class EssentialsProtectBlockListener implements Listener
}
final Material type = block.getType();
- if (prot.checkProtectionItems(ProtectConfig.alert_on_break, typeId))
+ if (!user.hasPermission("essentials.protect.alerts.notrigger")
+ && prot.checkProtectionItems(ProtectConfig.alert_on_break, typeId))
{
prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke"));
}
diff --git a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
index 401bf345d..6e515e56d 100644
--- a/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
+++ b/EssentialsProtect/src/com/earth2me/essentials/protect/EssentialsProtectPlayerListener.java
@@ -83,6 +83,7 @@ public class EssentialsProtectPlayerListener implements Listener
}
}
if (item != null
+ && !user.hasPermission("essentials.protect.alerts.notrigger")
&& prot.checkProtectionItems(ProtectConfig.alert_on_use, item.getTypeId()))
{
prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed"));