Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require in suggestions LOL #99

Open
DietrichPaul opened this issue Sep 19, 2021 · 1 comment
Open

require in suggestions LOL #99

DietrichPaul opened this issue Sep 19, 2021 · 1 comment

Comments

@DietrichPaul
Copy link

i got bored and wanted to change the bukkit command system to brigadier's in 1.8 xD. Now i am facing the following problem:
if a literalargumenttype was registered with require in the dispatcher, it will still be displayed in suggestions if require is returning false 😒
if I have done something wrong, please tell me 😂.

image
image
image

@xhyrom
Copy link

xhyrom commented Jul 1, 2024

for (final CommandNode<S> node : parent.getChildren()) {
CompletableFuture<Suggestions> future = Suggestions.empty();
try {
future = node.listSuggestions(context.build(truncatedInput), new SuggestionsBuilder(truncatedInput, truncatedInputLowerCase, start));
} catch (final CommandSyntaxException ignored) {
}
futures[i++] = future;

there could be something like this:

if (!node.canUse(context.getSource())) {
    futures[i++] = Suggestions.empty();
    continue;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants