Skip to content

v3.1.0

Choose a tag to compare

@Mqzn Mqzn released this 21 Mar 00:00
· 87 commits to master since this release

Critical patch:

This patch includes a new feature, several bug fixes and a single breaking change

Breaking API Change:

Refactored the ArgumentType#parse , now the method is two.
ArgumentType now has two parse methods.
One that needs only a single string, and one for complex parsing:

image

Why ?

Because parsing doesn't happen only through out the execution with the instance of Cursor at runtime.
It happens during default value providing, which needs only a string, and even before execution during the tree-traversal.
This way, things are more clear and simpler.
Moreover, the old method sometimes provided different values of correspondingInput and the current raw-input from Cursor.
causing confusion for the users.

Bug fixes:

  • Fixed Initialization error for BukkitImperat in the bukkit module
  • Fixed NPE error on brigadier integration with the bukkit module.

NEW Feature

Introducing @PathwayCommand:
When you wanted to create a hierarchy of subcommands you usually will need to create nested class for each subcommand level.
With this new feature there's no need to do that anymore (that doesn't mean the old way is useless).
Here's an example:

public class RankCommand {

    @PathwayCommand("rank <rank> permission set <perm> [value]")
    public void setPermission(TestCommandSource source, String rank, String perm, @Default("true") boolean value) {
        System.out.println("Set permission " + perm + " to " + value + " for rank " + rank);
    }

    @PathwayCommand("rank <rank> permission unset <perm>")
    public void unsetPermission(TestCommandSource source, String rank, String perm) {
        System.out.println("Unset permission " + perm + " for rank " + rank);
    }

}

Full Changelog: v3.0.0...v3.1.0