forked from Minecraft/QoL
Added console auditing
parent
d2c573d21c
commit
c6981f7838
|
@ -19,6 +19,7 @@ import java.util.logging.Logger;
|
|||
@MavenLibrary(group = "net.ess3", artifact = "Essentials", version = "2.13.1", repository = "http://repo.ess3.net/content/groups/essentials")
|
||||
@MavenLibrary(group = "us.dynmap", artifact = "dynmap-api", version = "1.9.4", repository = "http://repo.mikeprimm.com/")
|
||||
@MavenLibrary(group = "commons-lang", artifact = "commons-lang", version = "2.6")
|
||||
|
||||
public class QoL extends MavenPlugin {
|
||||
|
||||
private static QoL instance;
|
||||
|
|
|
@ -9,6 +9,7 @@ import org.bukkit.entity.Player;
|
|||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.event.server.ServerCommandEvent;
|
||||
import xyz.etztech.core.CoreUtils;
|
||||
import xyz.etztech.core.web.CoreWeb;
|
||||
import xyz.etztech.qol.QoL;
|
||||
|
@ -30,6 +31,18 @@ public class CommandPreprocessListener implements Listener {
|
|||
this.plugin = plugin;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerCommandEvent(ServerCommandEvent event) {
|
||||
if (plugin.getConfig().getBoolean("audit.enabled")) {
|
||||
String command = event.getCommand();
|
||||
|
||||
if (commandIsAuditable(command)) {
|
||||
sendAuditWebhook("Console", null, command);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onPlayerCommandPreprocess(PlayerCommandPreprocessEvent event) {
|
||||
|
||||
|
|
Loading…
Reference in New Issue