Move to an improved CommandRouter, improve routing logic

now supports splitting commands over multiple BaseCommands better
should now only match probable @Default handlers, so @CatchUnknown
can still work in obviously wrong scenarios.

@HelpCommand no longer implies @Default as @CatchUnknown will pick it up
This commit is contained in:
Aikar
2019-02-25 00:39:36 -05:00
parent 975eb22afd
commit 67d631d47c
14 changed files with 261 additions and 276 deletions
@@ -1,9 +1,11 @@
package co.aikar.acfexample;
import co.aikar.commands.BaseCommand;
import co.aikar.commands.CommandHelp;
import co.aikar.commands.annotation.CatchUnknown;
import co.aikar.commands.annotation.CommandAlias;
import co.aikar.commands.annotation.Default;
import co.aikar.commands.annotation.HelpCommand;
import co.aikar.commands.annotation.Single;
import co.aikar.commands.annotation.Subcommand;
import org.bukkit.command.CommandSender;
@@ -31,4 +33,9 @@ public class SomeOtherCommand extends BaseCommand {
public void test(Player player, String string, @Default("1") int integer) {
player.sendMessage("Hi " + string + " - " + integer);
}
@HelpCommand
public void onHelp(CommandSender sender, CommandHelp help) {
help.showHelp();
}
}