mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-04-27 00:49:44 +00:00
Add new permission essentials.protect.alerts.notrigger
If user has this permisson they do not trigger EssProtect block alerts
This commit is contained in:
parent
4b61ac9043
commit
f93769dd1d
2 changed files with 5 additions and 2 deletions
|
@ -51,7 +51,8 @@ public class EssentialsProtectBlockListener implements Listener
|
||||||
return;
|
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"));
|
prot.getEssentialsConnect().alert(user, blockPlaced.getType().toString(), _("alertPlaced"));
|
||||||
}
|
}
|
||||||
|
@ -249,7 +250,8 @@ public class EssentialsProtectBlockListener implements Listener
|
||||||
}
|
}
|
||||||
final Material type = block.getType();
|
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"));
|
prot.getEssentialsConnect().alert(user, type.toString(), _("alertBroke"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -83,6 +83,7 @@ public class EssentialsProtectPlayerListener implements Listener
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item != null
|
if (item != null
|
||||||
|
&& !user.hasPermission("essentials.protect.alerts.notrigger")
|
||||||
&& prot.checkProtectionItems(ProtectConfig.alert_on_use, item.getTypeId()))
|
&& prot.checkProtectionItems(ProtectConfig.alert_on_use, item.getTypeId()))
|
||||||
{
|
{
|
||||||
prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed"));
|
prot.getEssentialsConnect().alert(user, item.getType().toString(), _("alertUsed"));
|
||||||
|
|
Loading…
Reference in a new issue