Exemple #1
0
  public static void getSave() {
    formatHelp("save", " <name>", "Saves the region for future use", "");
    Message.sendMessage(" If no name is provided, the default name will be used");
    Message.sendMessage(" The default name is defined in the configuration file");

    return;
  }
Exemple #2
0
 public static void getAuto() {
   formatHelp("auto", " toggle", "Toggles the automatic resets on and off", "");
   formatHelp(
       "auto", " time <time>", "Changes the automatic reset time to the value specified", "");
   Message.sendMessage(" The value cannot be smaller then 5 minutes");
   formatHelp("auto", " warning toggle", "Toggles warnings before the reset on and off", "");
   formatHelp("auto", " warning add <time>", "Adds a warning at time specified", "");
   formatHelp("auto", " warning remove <time>", "Adds a warning at time specified", "");
   Message.sendMessage(" The value cannot be larger then the reset time");
 }
Exemple #3
0
  public static void getSelect() {
    formatHelp(
        "select", " hpos1", "Creates a reference point 1 at the block you are looking at", "");
    formatHelp(
        "select", " hpos2", "Creates a reference point 2 at the block you are looking at", "");
    Message.sendMessage(" Your field of view is limited to 100 blocks");
    formatHelp("select", " pos1", "Creates a reference point 1 at your immediate location", "");
    formatHelp("select", " pos2", "Creates a reference point 2 at your immediate location", "");
    Message.sendMessage(" You can also select a region with your normal World Edit tool");

    return;
  }
Exemple #4
0
 public static void getBlacklist() {
   formatHelp("blacklist", " toggle", "Enables the use of blacklist for the mine", "");
   formatHelp("blacklist", " whitelist", "Makes the blacklist be treated as a whitelist", "");
   Message.sendMessage(" Blacklist should be enabled");
   formatHelp("blacklist", " add <block>", "Adds a block to the blacklist", "");
   formatHelp("blacklist", " remove <block>", "Removes a block from the whitelist", "");
 }
Exemple #5
0
  public static void getHelp() {
    String title = Language.getString("general.title");
    Message.sendMessage("                    -=[ " + title + " ]=-");

    formatHelp("info", " <name>", "Returns the information about a mine", "info");
    formatHelp("list", "", "Lists all the available mines", "list");
    formatHelp("warp", " <name>", "Teleports you to the mine warp location", "warp");
    formatHelp("reset", " <name>", "Resets the mine manually", "reset");
    formatHelp("select", "", "Shows region selection help page", "edit");
    formatHelp("save", " <name>", "Saves the region for future use", "edit");
    formatHelp("edit", "", "Shows a help page on how to handle the mine options", "edit");
    formatHelp("delete", " <name>", "Completely deletes a mine", "edit");
    formatHelp("auto", "", "Shows a help page on how to automate the mine", "edit");
    formatHelp("protection", "", "Shows how to set up a mine protection", "edit");

    return;
  }
Exemple #6
0
 public static void getConfig() {
   Message.sendMessage(" You do NOT need these commands. At all. I promise.");
   formatHelp("config", " save", "Saves the data into a configuration file", "");
   formatHelp("config", " load", "Loads the configuration from a file", "");
 }
Exemple #7
0
  public static void run(String[] args) {
    if (!Util.senderHasPermission("time")) {
      Message.sendDenied(args);
      return;
    }

    String mineName = null;
    if (args.length == 1) {
      if (CommandManager.getMine() != null) {
        mineName = CommandManager.getMine();
      } else {
        Help.getInfo();
        return;
      }
    }
    if (args.length > 2) {
      Message.sendInvalid(args);
      return;
    }

    if (args.length != 1 && !Mine.exists(args[1])) {
      Message.sendError(
          "Mine '"
              + args[1]
              + "' does not exist. Use "
              + ChatColor.GREEN
              + "/mine help"
              + ChatColor.WHITE
              + " for help");
      return;
    }

    if (mineName == null) mineName = args[1];

    String displayName = Regions.getString("mines." + mineName + ".display-name");
    if (displayName.equals("")) displayName = mineName;

    // Reset
    boolean autoReset = Regions.getBoolean("mines." + mineName + ".reset.auto.reset");
    int autoResetTime = Regions.getInt("mines." + mineName + ".reset.auto.reset-time");
    int nextResetMin = Regions.getInt("mines." + mineName + ".reset.auto.data.min");
    int nextResetSec = Regions.getInt("mines." + mineName + ".reset.auto.data.sec");

    if (autoReset) {
      Message.sendSuccess(
          displayName
              + " resets every "
              + ChatColor.GOLD
              + autoResetTime
              + ChatColor.WHITE
              + " minutes. Next reset in "
              + ChatColor.GOLD
              + nextResetMin
              + ChatColor.WHITE
              + " minutes "
              + ChatColor.GOLD
              + nextResetSec
              + ChatColor.WHITE
              + " seconds");
    } else {
      Message.sendSuccess(displayName + " has to be reset manually");
    }
  }