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

Allow per-parameter tab completion #297

Open
lus opened this issue Oct 15, 2020 · 3 comments
Open

Allow per-parameter tab completion #297

lus opened this issue Oct 15, 2020 · 3 comments
Labels
core Related to the ACF Core

Comments

@lus
Copy link

lus commented Oct 15, 2020

Hello. I define the following command:

@Subcommand("create")
    public CompletableFuture<Punishment> handlePunishmentCreateCommand(CommandSender sender, Player target, PunishmentType type, int duration, String reason) { //... }

and I see that this framework automatically includes the tab completion for PunishmentType, which is an enum, but does not automatically suggest players for the target parameter.
Now I need to register tab completion just for this exact parameter to make it functional, but I could not find any way to do so.

It would be nice if that could be implemented.

Kind regards,
Lukas

@Joo200
Copy link
Contributor

Joo200 commented Oct 15, 2020

You should annotate Player target with @Flags("other") Player target or use the wrapper class OnlinePlayer insted to tell acf that you want to resolve the player object from an argument. With your current implementation acf transforms the command issuer to the player object.

With that the command completions should work fine

@lus
Copy link
Author

lus commented Oct 15, 2020

Ooh, that sounds reasonable to me. I'll try it asap.
Thank you very much!

@lus
Copy link
Author

lus commented Oct 15, 2020

Now I am using the other flag and I can punish players on that server but the tab completion still doesn't work.

@chickeneer chickeneer added the core Related to the ACF Core label Jun 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to the ACF Core
Projects
None yet
Development

No branches or pull requests

3 participants