// 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)); }
// Special chat: @Command( aliases = {"sc"}, usage = "<message>", flags = "", desc = "Sends a message in the special chat.", min = 1) @CommandPermissions({"saga.special.player.chat"}) public static void specialChat(CommandContext args, Saga plugin, SagaPlayer sagaPlayer) { // Send special message: String message = PlayerMessages.specialChatMessage(sagaPlayer.getName(), args.getJoinedStrings(0)); chatMessage(message); }
@Command( aliases = {"ability", "pabilityinfo, abilityinfo"}, usage = "<ability_name>", flags = "", desc = "Display ability information.", min = 1) @CommandPermissions({"saga.user.help.player.abilityinfo"}) public static void abilityInfo(CommandContext args, Saga plugin, SagaPlayer sagaPlayer) { AbilityDefinition definition = null; String abilityName = null; // Arguments: abilityName = GeneralMessages.nameFromArg(args.getJoinedStrings(0)); definition = AbilityConfiguration.config().getDefinition(abilityName); if (definition == null) { sagaPlayer.message(AbilityMessages.invalidAbility(abilityName)); return; } // Inform: sagaPlayer.message(HelpMessages.ability(definition)); }