mirror of
https://github.com/PaperMC/Paper.git
synced 2024-11-29 11:42:55 +01:00
Ensure we always log commands and log the right thing.
Waiting to log until after PlayerCommandPreprocessEvent makes the server not log anything if the event is cancelled. It also makes the server log what a plugin changed the command to instead of what the player actually tried to run. As the point of the log is to have a record of every command a player attempts to run these are both not desirable.
This commit is contained in:
parent
fa1b6ba834
commit
89d5265da6
1 changed files with 2 additions and 1 deletions
|
@ -941,6 +941,8 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
|
||||
private void handleCommand(String s) {
|
||||
// CraftBukkit start - whole method
|
||||
this.c.info(this.player.getName() + " issued server command: " + s);
|
||||
|
||||
CraftPlayer player = this.getPlayer();
|
||||
|
||||
PlayerCommandPreprocessEvent event = new PlayerCommandPreprocessEvent(player, s, new LazyPlayerSet());
|
||||
|
@ -951,7 +953,6 @@ public class PlayerConnection implements PacketPlayInListener {
|
|||
}
|
||||
|
||||
try {
|
||||
this.c.info(event.getPlayer().getName() + " issued server command: " + event.getMessage());
|
||||
if (this.server.dispatchCommand(event.getPlayer(), event.getMessage().substring(1))) {
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue