Merge pull request #300 from Leymooo/command-event

fix command forwarding to server
This commit is contained in:
Andrew Steinborn
2020-04-29 15:26:29 -04:00
committed by GitHub
2 changed files with 3 additions and 3 deletions

View File

@@ -131,13 +131,13 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
Optional<String> 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(),