command completion

This commit is contained in:
Sen 2025-03-26 13:27:17 +01:00
parent 4a3828e310
commit e88958e2f4
16 changed files with 66 additions and 51 deletions

View file

@ -1,5 +1,6 @@
package game.command;
import java.util.Collection;
import java.util.List;
import game.collect.Lists;
import game.network.Player;
@ -23,10 +24,10 @@ public class PlayerListParser extends PlayerParser {
return net == null ? null : Lists.newArrayList(net);
}
public String[] getCompletions(CommandEnvironment env) {
List<String> comp = Lists.newArrayList(env.getServer().getAllUsernames());
public Collection<String> getCompletions(CommandEnvironment env) {
Collection<String> comp = super.getCompletions(env);
comp.add("*");
return comp.toArray(new String[comp.size()]);
return comp;
}
public Class<?> getTypeClass() {