This commit is contained in:
kento2 2026-07-05 00:36:48 +02:00
parent 9aa138058c
commit b234cd9df7
17 changed files with 51 additions and 56 deletions

View file

@ -22,7 +22,7 @@ public class CommandAPI {
public void register(RootCommandNode<CommandSource> rootNode) {
var cm = server.getCommandManager();
var meta = cm.metaBuilder(rootNode.getNames()[0])
.aliases(Arrays.copyOfRange(rootNode.getNames(), 1, rootNode.getNames().length - 1))
.aliases(Arrays.copyOfRange(rootNode.getNames(), 1, rootNode.getNames().length))
.build();
cm.register(meta, new VelocityCommand(commandHandler, rootNode));
}

View file

@ -7,7 +7,6 @@ import de.kentoj.kencommandapi.api.node.RootCommandNode;
import lombok.RequiredArgsConstructor;
import java.util.List;
import java.util.concurrent.CompletableFuture;
@RequiredArgsConstructor
public class VelocityCommand implements SimpleCommand {
@ -27,7 +26,7 @@ public class VelocityCommand implements SimpleCommand {
}
@Override
public CompletableFuture<List<String>> suggestAsync(Invocation invocation) {
public List<String> suggest(Invocation invocation) {
return commandHandler.getSuggestions(rootNode, invocation.source(), invocation.arguments());
}
}

View file

@ -15,10 +15,9 @@ public class PlayerSuggestionProvider implements SuggestionProvider<CommandSourc
private final ProxyServer proxyServer;
@Override
public CompletableFuture<List<String>> suggest(CommandSource __) {
var list = proxyServer.getAllPlayers().stream()
public List<String> suggest(CommandSource __) {
return proxyServer.getAllPlayers().stream()
.map(Player::getUsername)
.toList();
return CompletableFuture.completedFuture(list);
}
}