Make log notifications toggleable
This commit is contained in:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user