mirror of
https://github.com/aikar/commands.git
synced 2026-05-31 06:11:55 +00:00
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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user