Пример #1
0
  public void signInfo(Sign sign, Map map) {
    int number = map.getSignNumber(sign);
    message("*******************************");
    message(ChatColor.WHITE + "" + ChatColor.BOLD + sign.getTypeName() + " #" + number);
    message("*******************************");

    message("Inputs : " + this.editor.displayInputs(sign));
    message("Outputs ON : " + this.editor.displayOutputs(sign, true));
    message("Outputs OFF : " + this.editor.displayOutputs(sign, false));

    message(ChatColor.YELLOW + "" + ChatColor.BOLD + "Options :");

    for (String key : sign.getOptions().keySet()) {
      message(ChatColor.WHITE + key + " : " + ChatColor.GRAY + sign.getOptions().get(key));
    }

    for (String key : sign.getDefaultOptions().keySet()) {
      if (sign.getOptions().containsKey(key)) continue;
      message(
          ChatColor.GRAY
              + ""
              + ChatColor.ITALIC
              + key
              + " : "
              + ChatColor.GRAY
              + sign.getDefaultOptions().get(key).getValue()
              + " ("
              + sign.getDefaultOptions().get(key).getOptionType().name().toLowerCase()
              + ")");
    }
  }
Пример #2
0
  public void find() {
    if (!(this.sender instanceof Player)) return;

    Player p = (Player) this.sender;
    Map map = this.editor.getMap(p.getWorld());
    if (map == null) return;

    ArrayList<Sign> results;

    if (this.args.length == 1) {
      message("Searching for signs...");
      results = map.getSigns();
    } else {
      results = new ArrayList<Sign>();
      for (Sign s : map.getSigns()) {
        if (s.getObjectName().contains(this.args[1])) {
          results.add(s);
        }
      }
    }

    message(results.size() + " signs found :");

    for (Sign sign : results) {

      int n = map.getSignNumber(sign);
      int distance = (int) Math.round(sign.getRealLocation(p.getWorld()).distance(p.getLocation()));
      message(
          "#"
              + n
              + " "
              + ChatColor.WHITE
              + sign.getTypeName()
              + ChatColor.GRAY
              + " ("
              + distance
              + "m)");
    }
  }