// Info: @Command( aliases = {"stats"}, usage = "[page]", flags = "", desc = "Shows player stats.", min = 0, max = 1) @CommandPermissions({"saga.user.player.stats"}) public static void stats(CommandContext args, Saga plugin, SagaPlayer sagaPlayer) { Integer page = null; // Arguments: if (args.argsLength() == 1) { String argsPage = args.getString(0); try { page = Integer.parseInt(argsPage); } catch (NumberFormatException e) { sagaPlayer.message(GeneralMessages.notNumber(argsPage)); return; } } else { page = 1; } // Inform: sagaPlayer.message(StatsMessages.stats(sagaPlayer, page - 1)); }
// Info: @Command( aliases = {"phelp"}, usage = "[page]", flags = "", desc = "Display player help.", min = 0, max = 1) @CommandPermissions({"saga.user.help.player"}) public static void help(CommandContext args, Saga plugin, SagaPlayer sagaPlayer) { Integer page = null; // Arguments: if (args.argsLength() == 1) { try { page = Integer.parseInt(args.getString(0)); } catch (NumberFormatException e) { sagaPlayer.message(GeneralMessages.notNumber(args.getString(0))); return; } } else { page = 0; } // Inform: sagaPlayer.message(HelpMessages.phelp(page - 1)); }