Mirror von
https://github.com/PaperMC/Velocity.git
synchronisiert 2024-11-17 05:20:14 +01:00
Fix Checkstyle errors.
Dieser Commit ist enthalten in:
Ursprung
0cb4c02107
Commit
abd81a0216
@ -155,27 +155,6 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private CompletableFuture<Void> 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
|
@Override
|
||||||
public boolean handle(TabCompleteRequest packet) {
|
public boolean handle(TabCompleteRequest packet) {
|
||||||
boolean isCommand = !packet.isAssumeCommand() && packet.getCommand().startsWith("/");
|
boolean isCommand = !packet.isAssumeCommand() && packet.getCommand().startsWith("/");
|
||||||
@ -485,6 +464,27 @@ public class ClientPlaySessionHandler implements MinecraftSessionHandler {
|
|||||||
}, player.getConnection().eventLoop());
|
}, player.getConnection().eventLoop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private CompletableFuture<Void> 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.
|
* Immediately send any queued messages to the server.
|
||||||
*/
|
*/
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren