From 7fae141e331a008aa691d785058f11a5825b5289 Mon Sep 17 00:00:00 2001 From: Luck Date: Thu, 13 Aug 2020 11:03:24 +0100 Subject: [PATCH] Ignore cancelled events for OP command disabling (#2527) --- .../luckperms/bukkit/listeners/BukkitPlatformListener.java | 6 +++--- .../luckperms/nukkit/listeners/NukkitPlatformListener.java | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitPlatformListener.java b/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitPlatformListener.java index 98bc3c5a5..932229b66 100644 --- a/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitPlatformListener.java +++ b/bukkit/src/main/java/me/lucko/luckperms/bukkit/listeners/BukkitPlatformListener.java @@ -49,17 +49,17 @@ public class BukkitPlatformListener implements Listener { this.plugin = plugin; } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onPlayerCommand(PlayerCommandPreprocessEvent e) { handleCommand(e.getPlayer(), e.getMessage().toLowerCase(), e); } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onServerCommand(ServerCommandEvent e) { handleCommand(e.getSender(), e.getCommand().toLowerCase(), e); } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onRemoteServerCommand(RemoteServerCommandEvent e) { handleCommand(e.getSender(), e.getCommand().toLowerCase(), e); } diff --git a/nukkit/src/main/java/me/lucko/luckperms/nukkit/listeners/NukkitPlatformListener.java b/nukkit/src/main/java/me/lucko/luckperms/nukkit/listeners/NukkitPlatformListener.java index 80fe0a895..328e6e967 100644 --- a/nukkit/src/main/java/me/lucko/luckperms/nukkit/listeners/NukkitPlatformListener.java +++ b/nukkit/src/main/java/me/lucko/luckperms/nukkit/listeners/NukkitPlatformListener.java @@ -48,17 +48,17 @@ public class NukkitPlatformListener implements Listener { this.plugin = plugin; } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onPlayerCommand(PlayerCommandPreprocessEvent e) { handleCommand(e.getPlayer(), e.getMessage().toLowerCase(), e); } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onServerCommand(ServerCommandEvent e) { handleCommand(e.getSender(), e.getCommand().toLowerCase(), e); } - @EventHandler + @EventHandler(ignoreCancelled = true) public void onRemoteServerCommand(RemoteServerCommandEvent e) { handleCommand(e.getSender(), e.getCommand().toLowerCase(), e); }