From b2df42a51c88be55ca1b5305b38072cc717bf369 Mon Sep 17 00:00:00 2001 From: Business Goose <44676012+business-goose@users.noreply.github.com> Date: Sat, 12 Dec 2020 16:59:04 +0000 Subject: [PATCH] Disable the ability to view cancelled player commands (#2) * Disable the ability to view cancelled player commands This would mean that you cannot see the commands of persons who have been ICU controlled. This would be a nice quality-of-life update because some bots who have been ICU controlled can still clog up CommandSpy even though their commands mean nothing. * Move check outside the loop, per mathiascode's request * Remove superfluous check --- src/main/java/pw/kaboom/commandspy/Main.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/main/java/pw/kaboom/commandspy/Main.java b/src/main/java/pw/kaboom/commandspy/Main.java index b63687c..76204d1 100644 --- a/src/main/java/pw/kaboom/commandspy/Main.java +++ b/src/main/java/pw/kaboom/commandspy/Main.java @@ -66,6 +66,10 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener @EventHandler void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) { + if (event.isCancelled()) { + return; + } + for (String uuidString : config.getKeys(false)) { UUID uuid = UUID.fromString(uuidString);