Пример #1
0
  /**
   * Walk along the tile path
   *
   * @param tPath The path to traverse
   * @return True when at the end of the path, False otherwise.
   */
  public static boolean WalkPath(TilePath tPath) {
    if (!CanExecute()) return false;

    Walking.walkTilePath(tPath);

    Player ply = Players.getLocal();

    if (ply != null) {
      if (ply.getLocation().distance(tPath.getEnd()) < 2f) {
        return true;
      }
    }

    return false;
  }
Пример #2
0
  /**
   * Walk along the tile path
   *
   * @param path The path to traverse
   * @return True when at the end of the path, False otherwise.
   */
  public static boolean WalkPath(Tile[] path) {
    if (!CanExecute()) return false;

    TilePath tPath = Walking.newTilePath(path);
    Walking.walkTilePath(tPath);

    Player ply = Players.getLocal();

    if (ply != null) {
      if (ply.getLocation().distance(path[path.length - 1]) < 2f) {
        return true;
      }
    }

    return false;
  }