fix command forwarding
This commit is contained in:
@@ -131,13 +131,13 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
Optional<String> eventCommand = event.getResult().getCommand();
|
Optional<String> eventCommand = event.getResult().getCommand();
|
||||||
String command = eventCommand.orElse(event.getCommand());
|
String command = eventCommand.orElse(event.getCommand());
|
||||||
if (commandResult.isForwardToServer()) {
|
if (commandResult.isForwardToServer()) {
|
||||||
smc.write(Chat.createServerbound(command));
|
smc.write(Chat.createServerbound("/" + command));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (commandResult.isAllowed()) {
|
if (commandResult.isAllowed()) {
|
||||||
try {
|
try {
|
||||||
if (!server.getCommandManager().executeImmediately(player, command)) {
|
if (!server.getCommandManager().executeImmediately(player, command)) {
|
||||||
smc.write(Chat.createServerbound(command));
|
smc.write(Chat.createServerbound("/" + command));
|
||||||
}
|
}
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.info("Exception occurred while running command for {}", player.getUsername(),
|
logger.info("Exception occurred while running command for {}", player.getUsername(),
|
||||||
|
Reference in New Issue
Block a user