Examples of MorePageDisplay


Examples of logisticspipes.commands.chathelper.MorePageDisplay

    return new String[]{"Lists all wrapper and their status."};
  }
 
  @Override
  public void executeCommand(ICommandSender sender, String[] args) {
    MorePageDisplay display = new MorePageDisplay(new String[]{"|< Wrapper status - Page: %/$ >|"}, sender);
    for(AbstractWrapper controller:LogisticsWrapperHandler.wrapperController) {
      StringBuilder builder = new StringBuilder();
      builder.append(ChatColor.AQUA);
      builder.append(controller.getName());
      builder.append(controller.getTypeName());
      builder.append(": ");
      if(controller.getState() == WrapperState.Enabled) {
        builder.append(ChatColor.GREEN);
        builder.append("enabled");
      } else if (controller.getState() == WrapperState.ModMissing) {
        builder.append(ChatColor.GRAY);
        builder.append("disabled (mod not found)");
      } else if(controller.getState() == WrapperState.Exception) {
        builder.append(ChatColor.RED);
        builder.append("disabled (exception)");
      } else {
        builder.append(ChatColor.BLUE);
        builder.append("disabled (" + controller.getReason() + ")");
      }
      display.append(builder.toString());
    }
    display.display(sender);
  }
View Full Code Here

Examples of logisticspipes.commands.chathelper.MorePageDisplay

    return new String[]{"Display the changelog between this version", "and the newest one"};
  }
 
  @Override
  public void executeCommand(ICommandSender sender, String[] args) {
    MorePageDisplay display = new MorePageDisplay(new String[] {"(The newest version is #" + VersionChecker.newVersion + ")", "< Changelog Page %/$ >"}, sender);
    for(String msg:VersionChecker.changeLog) {
        display.append(msg);
      }
    display.display(sender);
  }
View Full Code Here

Examples of logisticspipes.commands.chathelper.MorePageDisplay

    }
    subCommands.add(newHandler);
  }
 
  public final void displayHelp(ICommandSender sender) {
    MorePageDisplay display = new MorePageDisplay(new String[]{"|< Help - " + this.getNames()[0] + " - Page: %/$ >|"}, sender);
    for(ICommandHandler command:subCommands) {
      if(!command.getDescription()[0].startsWith("#")) {
        boolean first = true;
        String prefix = (command instanceof SubCommandHandler ? ChatColor.BLUE : ChatColor.YELLOW) + command.getNames()[0] + ChatColor.RESET + ": ";
        for(int d=0;d<command.getDescription().length;d++) {
          display.append(prefix + command.getDescription()[d], !first);
          prefix = "    ";
          first = false;
        }
        if(command instanceof SubCommandHandler) {
          display.append("      " + ChatColor.GRAY + "- add " + ChatColor.YELLOW + "help" + ChatColor.GRAY + " to see the subcommands", true);
        }
        first = true;
        if(command.getNames().length > 1) {
          for(int i=1;i<command.getNames().length;i++) {
            display.append((first ? "  alias: - " : "         - ") + ChatColor.GOLD + command.getNames()[i] + "", true);
            first = false;
          }
        }
        display.append("", true);
      }
    }
    display.display(sender);
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.