Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
astei committed Oct 29, 2023
1 parent 2ec830f commit 8dcc7ee
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -83,8 +83,14 @@ public void register() {
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.getAllServers()) {
builder.suggest(server.getServerInfo().getName());
String serverName = server.getServerInfo().getName();
if (serverName.regionMatches(true, 0, argument, 0, argument.length())) {
builder.suggest(server.getServerInfo().getName());
}
}
return builder.buildFuture();
})
Expand Down

0 comments on commit 8dcc7ee

Please sign in to comment.