mirror of
https://github.com/PaperMC/Velocity.git
synced 2026-02-17 06:27:42 +01:00
Fix
This commit is contained in:
@@ -84,9 +84,15 @@ public class SendCommand {
|
||||
ArgumentCommandNode<CommandSource, String> serverNode = RequiredArgumentBuilder
|
||||
.<CommandSource, String>argument("server", StringArgumentType.word())
|
||||
.suggests((context, builder) -> {
|
||||
String argument = context.getArguments().containsKey(SERVER_ARG)
|
||||
? context.getArgument(SERVER_ARG, String.class)
|
||||
: "";
|
||||
for (RegisteredServer server : server.registeredServers()) {
|
||||
String serverName = server.serverInfo().name();
|
||||
if (serverName.regionMatches(true, 0, argument, 0, argument.length())) {
|
||||
builder.suggest(server.serverInfo().name());
|
||||
}
|
||||
}
|
||||
return builder.buildFuture();
|
||||
})
|
||||
.executes(this::send)
|
||||
|
||||
Reference in New Issue
Block a user