Make log notifications toggleable

This commit is contained in:
Luck
2016-08-30 16:02:01 +01:00
Unverified
parent b37fdd3619
commit 9b4bbe0500
5 changed files with 14 additions and 0 deletions
@@ -102,6 +102,10 @@ public abstract class LPConfiguration<T extends LuckPermsPlugin> {
return getBoolean("apply-shorthand", true);
}
public boolean getLogNotify() {
return getBoolean("log-notify", true);
}
public DatastoreConfiguration getDatabaseValues() {
return new DatastoreConfiguration(
getString("data.address", null),
@@ -52,6 +52,7 @@ public class LogEntry extends me.lucko.luckperms.api.LogEntry {
plugin.getDatastore().logAction(this);
LogNotifyEvent event = new LogNotifyEvent(this);
event.setCancelled(plugin.getConfiguration().getLogNotify());
plugin.getApiProvider().fireEvent(event);
if (event.isCancelled()) return;