Skip to content

Command arguments getting mixed up #4

@Adrian646

Description

@Adrian646

Hello, I've noticed when using AnyVersion V2.3.1 that some of my command arguments from my RankCommand are getting mixed up with a random command.

I'm running:

  • Minecraft Version: 1.21.114 (latest UWP version before the GDK switch)
  • PowerNukkitX: latest (updated about 3 days ago)
  • SyodogPE: latest

These are the arguments of my RankCommand:

    public RankCommand() {
        super("rank");
        this.setPermission("admin");

        List<RankEntity> ranks = rankService.getAllRanks();
        String[] rankNames = ranks.stream()
                .map(RankEntity::getName)
                .toArray(String[]::new);

        this.commandParameters.clear();
        this.commandParameters.put("create", new CommandParameter[]{
                CommandParameter.newEnum("create", new String[]{"create"})
        });
        this.commandParameters.put("set", new CommandParameter[]{
                CommandParameter.newEnum("set", new String[]{"set"}),
                CommandParameter.newType("player", CommandParamType.TARGET, new IPlayersNode()),
                CommandParameter.newEnum("rank", rankNames),
        });
        this.commandParameters.put("modify", new CommandParameter[]{
                CommandParameter.newEnum("modify", new String[]{"modify"}),
                CommandParameter.newEnum("rank", rankNames),
                CommandParameter.newEnum("type", new String[]{"rank", "permissions"}),
        });
        this.enableParamTree();
    }

This is how I register the Command:

        this.registerCommands(
                new RankCommand()
        );
    public void registerCommands(Command... commands) {
        for (Command command : commands) {
            this.getServer().getCommandMap().register("help", command);
        }
    }

This is the outcome:

Image

I am experiencing constant crashes when autocompleting the built-in PowerNukkitX DebugCommand so there should also be an issue with this.

Thanks for looking at my issue; hopefully it will be resolved soon! :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions