diff --git a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java index 930dd00df..3affdf9ea 100644 --- a/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java +++ b/proxy/src/main/java/com/velocitypowered/proxy/connection/client/ClientPlaySessionHandler.java @@ -155,27 +155,6 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { return true; } - private CompletableFuture processCommandExecuteResult(String originalCommand, - CommandResult result) { - if (result == CommandResult.denied()) { - return CompletableFuture.completedFuture(null); - } - - MinecraftConnection smc = player.ensureAndGetCurrentServer().ensureConnected(); - String commandToRun = result.getCommand().orElse(originalCommand); - if (result.isForwardToServer()) { - return CompletableFuture.runAsync(() -> smc.write(Chat.createServerbound("/" + - commandToRun)), smc.eventLoop()); - } else { - return server.getCommandManager().executeImmediatelyAsync(player, commandToRun) - .thenAcceptAsync(hasRun -> { - if (!hasRun) { - smc.write(Chat.createServerbound("/" + commandToRun)); - } - }, smc.eventLoop()); - } - } - @Override public boolean handle(TabCompleteRequest packet) { boolean isCommand = !packet.isAssumeCommand() && packet.getCommand().startsWith("/"); @@ -485,6 +464,27 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { }, player.getConnection().eventLoop()); } + private CompletableFuture processCommandExecuteResult(String originalCommand, + CommandResult result) { + if (result == CommandResult.denied()) { + return CompletableFuture.completedFuture(null); + } + + MinecraftConnection smc = player.ensureAndGetCurrentServer().ensureConnected(); + String commandToRun = result.getCommand().orElse(originalCommand); + if (result.isForwardToServer()) { + return CompletableFuture.runAsync(() -> smc.write(Chat.createServerbound("/" + + commandToRun)), smc.eventLoop()); + } else { + return server.getCommandManager().executeImmediatelyAsync(player, commandToRun) + .thenAcceptAsync(hasRun -> { + if (!hasRun) { + smc.write(Chat.createServerbound("/" + commandToRun)); + } + }, smc.eventLoop()); + } + } + /** * Immediately send any queued messages to the server. */