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

Command flags completion parser issues #3690

Closed
SettingDust opened this issue May 18, 2022 · 1 comment
Closed

Command flags completion parser issues #3690

SettingDust opened this issue May 18, 2022 · 1 comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working

Comments

@SettingDust
Copy link
Contributor

Affected Product(s)

SpongeVanilla

Version

1.16.5-8.0.0-RC1131

Operating System

Windows

Java Version

17.0.3 by JetBrains s.r.o.

Plugins/Mods

custom

Describe the bug

Repo: https://github.com/EpicBanItemTeam/EpicBanItem/blob/feature/api-8/src/main/java/team/ebi/epicbanitem/EBICommands.java#L91-L163=
It's looks like all caused by flags. The flag completion isn't correct.


Merge sub commands complete
图片
This command only have flags. The complete shows the others

// Current command
final var test =
    Command.builder()
        .shortDescription(Component.translatable("epicbanitem.command.test.description"))
        .extendedDescription(
            Component.translatable("epicbanitem.command.test.description.extended"))
        .permission(EpicBanItem.permission("command.test"))
        .addFlags(flags.block, flags.trigger, flags.world)
        .executor(this::test)
        .build();
// Merged command
final var create =
    Command.builder()
        .shortDescription(Component.translatable("epicbanitem.command.create.description"))
        .extendedDescription(
            Component.translatable("epicbanitem.command.create.description.extended"))
        .permission(EpicBanItem.permission("command.create"))
        .addFlags(flags.preset, flags.block)
        .addParameters(
            parameters.ruleName.key(keys.ruleName).build(),
            parameters.query.key(keys.query).optional().build())
        .executor(this::create)
        .build();

The flag without param can't as terminal.
图片


Flag with a param is fine
图片
But not without. It's merged with a command that have a SNBT arg https://github.com/EpicBanItemTeam/EpicBanItem/blob/feature/api-8/src/main/java/team/ebi/epicbanitem/EBICommands.java#L92-L101=
图片

Link to logs

No response

@SettingDust SettingDust added status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working labels May 18, 2022
@dualspiral
Copy link
Contributor

Duplicate of #3356

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: needs triage This label is automatically applied to new issues and pull requests to indicate they require triage type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants