use of com.elmakers.mine.bukkit.action.builtin.SkillSelectorAction in project MagicPlugin by elBukkit.
the class MagicSkillsCommandExecutor method onCommand.
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
if (!api.hasPermission(sender, "Magic.commands.mskills")) {
sendNoPermission(sender);
return true;
}
if (!(sender instanceof Player)) {
sender.sendMessage(ChatColor.RED + "This command may only be used in-game");
return true;
}
Mage mage = controller.getMage(sender);
SkillSelectorAction selector = new SkillSelectorAction();
int page = 1;
if (args.length > 0) {
try {
page = Integer.parseInt(args[0]);
} catch (Exception ex) {
sender.sendMessage(ChatColor.RED + "Expect page number, got " + args[0]);
return true;
}
}
selector.setPage(page);
selector.perform(new CastContext(mage));
return true;
}
Aggregations