示例#1
0
 private static String format(Command command, String alias) {
   return String.format(
       COMMAND_FORMAT,
       alias,
       (command.usage().isEmpty() ? "" : " " + command.usage()),
       Messaging.tryTranslate(command.desc()));
 }
示例#2
0
 private void sendSpecificHelp(CommandSender sender, String rootCommand, String modifier)
     throws CommandException {
   CommandInfo info = getCommand(rootCommand, modifier);
   if (info == null)
     throw new CommandException(CommandMessages.COMMAND_MISSING, rootCommand + " " + modifier);
   Messaging.send(sender, format(info.getCommandAnnotation(), rootCommand));
   String help = Messaging.tryTranslate(info.getCommandAnnotation().help());
   if (help.isEmpty()) return;
   Messaging.send(sender, ChatColor.AQUA + help);
 }