From aa55af8eb715ec512461e7c59cf66e36588a20dc Mon Sep 17 00:00:00 2001 From: Leymooo Date: Wed, 29 Apr 2020 22:08:59 +0300 Subject: [PATCH 1/2] fix command forwarding --- .../proxy/connection/client/ClientPlaySessionHandler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 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 e8b747bac..90e7ee6bb 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 @@ -131,13 +131,13 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler { Optional eventCommand = event.getResult().getCommand(); String command = eventCommand.orElse(event.getCommand()); if (commandResult.isForwardToServer()) { - smc.write(Chat.createServerbound(command)); + smc.write(Chat.createServerbound("/" + command)); return; } if (commandResult.isAllowed()) { try { if (!server.getCommandManager().executeImmediately(player, command)) { - smc.write(Chat.createServerbound(command)); + smc.write(Chat.createServerbound("/" + command)); } } catch (Exception e) { logger.info("Exception occurred while running command for {}", player.getUsername(), From d096eb342992568f780ebd287b6541a411115589 Mon Sep 17 00:00:00 2001 From: Leymooo Date: Wed, 29 Apr 2020 22:15:33 +0300 Subject: [PATCH 2/2] update class javadoc --- .../velocitypowered/api/event/command/CommandExecuteEvent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java b/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java index 054699568..8181e6a3e 100644 --- a/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java +++ b/api/src/main/java/com/velocitypowered/api/event/command/CommandExecuteEvent.java @@ -9,7 +9,7 @@ import org.checkerframework.checker.nullness.qual.NonNull; import org.checkerframework.checker.nullness.qual.Nullable; /** - * This event is fired when a player types in a chat message. + * This event is fired when someone executing command */ public final class CommandExecuteEvent implements ResultedEvent {