diff --git a/common/src/main/java/me/lucko/luckperms/common/debug/DebugHandler.java b/common/src/main/java/me/lucko/luckperms/common/debug/DebugHandler.java index 384621b41..744682344 100644 --- a/common/src/main/java/me/lucko/luckperms/common/debug/DebugHandler.java +++ b/common/src/main/java/me/lucko/luckperms/common/debug/DebugHandler.java @@ -39,6 +39,7 @@ public class DebugHandler implements Runnable { private final Map listeners; private final Queue queue; + private boolean listening = false; @Setter private boolean shutdown = false; @@ -52,16 +53,25 @@ public class DebugHandler implements Runnable { } public void offer(String checked, String node, Tristate value) { + if (!listening) { + return; + } + queue.offer(new CheckData(checked, node, value)); } public void register(Sender sender, String filter, boolean notify) { + listening = true; listeners.put(sender.getUuid(), new DebugListener(pluginVersion, sender, filter, notify)); } public DebugListener unregister(UUID uuid) { flush(); - return listeners.remove(uuid); + DebugListener ret = listeners.remove(uuid); + if (listeners.isEmpty()) { + listening = false; + } + return ret; } @Override