From abd81a0216ec191a81f1319cbe4bc8054f64b900 Mon Sep 17 00:00:00 2001 From: Andrew Steinborn Date: Mon, 25 May 2020 13:24:41 -0400 Subject: [PATCH] Fix Checkstyle errors. --- .../client/ClientPlaySessionHandler.java | 42 +++++++++---------- 1 file changed, 21 insertions(+), 21 deletions(-) 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. */