Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-12-27 16:40:10 +01:00
Match current command input for sub argument tab completions (#3496)
Dieser Commit ist enthalten in:
Ursprung
78c7f03923
Commit
2c6e18e4fe
@ -125,7 +125,15 @@ public abstract class ViaCommandHandler implements ViaVersionCommand {
|
|||||||
|
|
||||||
List<String> tab = sub.onTabComplete(sender, subArgs);
|
List<String> tab = sub.onTabComplete(sender, subArgs);
|
||||||
Collections.sort(tab);
|
Collections.sort(tab);
|
||||||
return tab;
|
if (!tab.isEmpty()) {
|
||||||
|
final String currArg = subArgs[subArgs.length - 1];
|
||||||
|
for (String s : tab) {
|
||||||
|
if (s.toLowerCase(Locale.ROOT).startsWith(currArg.toLowerCase(Locale.ROOT))) {
|
||||||
|
output.add(s);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return output;
|
return output;
|
||||||
|
@ -71,7 +71,6 @@ public class DebugSubCmd extends ViaSubCommand {
|
|||||||
@Override
|
@Override
|
||||||
public List<String> onTabComplete(final ViaCommandSender sender, final String[] args) {
|
public List<String> onTabComplete(final ViaCommandSender sender, final String[] args) {
|
||||||
if (args.length == 1) {
|
if (args.length == 1) {
|
||||||
//TODO match current input
|
|
||||||
return Arrays.asList("clear", "logposttransform", "add", "remove");
|
return Arrays.asList("clear", "logposttransform", "add", "remove");
|
||||||
}
|
}
|
||||||
return Collections.emptyList();
|
return Collections.emptyList();
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren