Add config option to disable packetevents debug logging (off by default)

Co-authored-by: funkemunky <30784509+funkemunky@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2026-02-20 17:33:41 +00:00
parent 477151cadc
commit 5f95dfc68e
2 changed files with 7 additions and 1 deletions
@@ -129,6 +129,9 @@ public class Anticheat extends JavaPlugin {
@ConfigSetting(path = "logging", name = "verbose")
private static boolean verboseLogging = true;
@ConfigSetting(path = "packetevents", name = "debug")
public static boolean packetEventsDebug = false;
private Configuration anticheatConfig;
@Override
@@ -137,6 +140,7 @@ public class Anticheat extends JavaPlugin {
getLogger().info("Loading Anticheat...");
LibraryLoader.loadAll(INSTANCE);
loadConfig();
PacketEventsRegister.register();
}
@@ -10,7 +10,9 @@ import io.github.retrooper.packetevents.factory.spigot.SpigotPacketEventsBuilder
public class PacketEventsRegister {
public static void register() {
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(Anticheat.INSTANCE, new PacketEventsSettings().debug(true).fullStackTrace(true).kickIfTerminated(false)));
boolean debug = Anticheat.INSTANCE.getAnticheatConfig()
.getBoolean("packetevents.debug", Anticheat.packetEventsDebug);
PacketEvents.setAPI(SpigotPacketEventsBuilder.build(Anticheat.INSTANCE, new PacketEventsSettings().debug(debug).fullStackTrace(true).kickIfTerminated(false)));
PacketEvents.getAPI().load();
}