Fixed that proxies would create non-existing command tab-completions

This commit is contained in:
rayzsyt committed 2026-02-17 03:10:57 +01:00
1 parent f447cf69d3
commit 8a86f05133
2 files changed
+13 -4

No files matched your search

@@ -78,6 +78,7 @@ public class SubArguments {
}
final List<String> inputs = source.getAllInputs();
final List<String> actuallyExistingCommands = helper.getChildrenNames();
if (turn) {
List<String> allEntries = inputs.stream().map(StringUtils::getFirstArg).toList();
@@ -98,8 +99,9 @@ public class SubArguments {
if (!negated) {
if (turn) helper.add(input, true);
else helper.removeSubArguments(input);
if (turn && actuallyExistingCommands.contains(StringUtils.getFirstArg(input))) {
helper.add(input, true);
} else helper.removeSubArguments(input);
continue;
}
@@ -112,7 +114,9 @@ public class SubArguments {
input = Storage.Blacklist.BlockTypeFetcher.cleanse(input);
if (turn) helper.removeSubArguments(input);
else helper.add(input, true);
else if (actuallyExistingCommands.contains(StringUtils.getFirstArg(input))) {
helper.add(input, true);
}
}
}
@@ -150,8 +150,13 @@ public class ProxyCommandNodeHelper<T> {
String part = args[index];
if (index == 0)
if (index == 0) {
part = Storage.Blacklist.BlockTypeFetcher.modify(Storage.Blacklist.BlockTypeFetcher.modify(part));
}
if (part.length() > 1 && part.startsWith("%") && part.endsWith("%")) {
return;
}
String next = index + 1 >= args.length ? null : args[index + 1];
CommandNode<T> childNode = parent.getChild(part);