mirror of
https://github.com/PaperMC/Velocity.git
synced 2025-01-24 14:54:03 +08:00
fix logic
This commit is contained in:
parent
6555e0e337
commit
1fb382e0f6
@ -128,15 +128,13 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
||||
server.getCommandManager().callCommandEvent(player, msg.substring(1))
|
||||
.thenAcceptAsync(event -> {
|
||||
CommandExecuteEvent.CommandResult commandResult = event.getResult();
|
||||
Optional<String> eventCommand = event.getResult().getCommand();
|
||||
String command = eventCommand.orElse(event.getCommand());
|
||||
if (commandResult.isForwardToServer()) {
|
||||
smc.write(Chat.createServerbound(command));
|
||||
return;
|
||||
}
|
||||
if (commandResult.isAllowed()) {
|
||||
Optional<String> eventCommand = event.getResult().getCommand();
|
||||
String command = eventCommand.orElse(event.getCommand());
|
||||
|
||||
if (commandResult.isForwardToServer()) {
|
||||
smc.write(Chat.createServerbound(command));
|
||||
return;
|
||||
}
|
||||
|
||||
try {
|
||||
if (!server.getCommandManager().execute(player, command)) {
|
||||
smc.write(Chat.createServerbound(command));
|
||||
|
Loading…
Reference in New Issue
Block a user