// 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)); }
@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)); }