mirror of
https://github.com/kaboomserver/commandspy.git
synced 2025-08-02 19:05:38 +00:00
fix: use MONITOR priority for the command event
This hides commands from players that are being controlled with iControlU.
This commit is contained in:
parent
d5c402cfc7
commit
130f06fe5a
1 changed files with 2 additions and 7 deletions
|
@ -1,6 +1,5 @@
|
|||
package pw.kaboom.commandspy;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
|
||||
import org.bukkit.Bukkit;
|
||||
|
@ -11,10 +10,10 @@ import org.bukkit.command.ConsoleCommandSender;
|
|||
import org.bukkit.configuration.file.FileConfiguration;
|
||||
import org.bukkit.entity.Player;
|
||||
import org.bukkit.event.EventHandler;
|
||||
import org.bukkit.event.EventPriority;
|
||||
import org.bukkit.event.Listener;
|
||||
import org.bukkit.event.block.SignChangeEvent;
|
||||
import org.bukkit.event.player.PlayerCommandPreprocessEvent;
|
||||
import org.bukkit.plugin.Plugin;
|
||||
import org.bukkit.plugin.java.JavaPlugin;
|
||||
import net.kyori.adventure.text.Component;
|
||||
import net.kyori.adventure.text.format.NamedTextColor;
|
||||
|
@ -71,12 +70,8 @@ public final class Main extends JavaPlugin implements CommandExecutor, Listener
|
|||
return true;
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@EventHandler(ignoreCancelled = true, priority = EventPriority.MONITOR)
|
||||
void onPlayerCommandPreprocess(final PlayerCommandPreprocessEvent event) {
|
||||
if (event.isCancelled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
final Player player = event.getPlayer();
|
||||
final NamedTextColor color = getTextColor(player);
|
||||
final Component message = Component.text(player.getName(), color)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue