Interface Route


public interface Route
  • Method Summary

    Modifier and Type
    Method
    Description
    createPoint(org.bukkit.Location location, RoutePointType type)
    Creates a new point at the specified location, and of the specified type.
    Gets the name of the route.
    int
    Gets the number of points this route contains.
    getPoint(int index)
    Gets the point at the specified index in this route.
    List<? extends RoutePoint>
    Gets the points this route contains as an immutable list.
    int
    Returns the index of the specified point in the route.
    insertPoint(int index, org.bukkit.Location location, RoutePointType type)
    Creates a new point at the specified location, and of the specified type.
    void
    removePoint(int index)
    Removes the point at the specified index.
    void
    Removes the specified point from the route.
    void
    Saves the route to disk in its current state.
  • Method Details

    • createPoint

      RoutePoint createPoint(org.bukkit.Location location, RoutePointType type)
      Creates a new point at the specified location, and of the specified type. The point is added to the end of the route.
      Parameters:
      location - location to place point at
      type - type of point
      Returns:
      the new point
    • insertPoint

      RoutePoint insertPoint(int index, org.bukkit.Location location, RoutePointType type)
      Creates a new point at the specified location, and of the specified type. The point is inserted at the specified index in the route.
      Parameters:
      index - the index to insert the point in the list
      location - location to place point at
      type - type of point
      Returns:
      the new point
    • getPoint

      RoutePoint getPoint(int index)
      Gets the point at the specified index in this route. If the specified index is out-of-bounds, this returns null instead.
      Parameters:
      index - the index of the point
      Returns:
      the point, or null
    • getPoints

      List<? extends RoutePoint> getPoints()
      Gets the points this route contains as an immutable list.
      Returns:
      the route points
    • getNumPoints

      int getNumPoints()
      Gets the number of points this route contains.
      Returns:
      amount of points
    • indexOf

      int indexOf(RoutePoint point)
      Returns the index of the specified point in the route. If the point does not belong to this route, it returns -1 instead.
      Parameters:
      point - the route point
      Returns:
      the index, or -1
    • removePoint

      void removePoint(int index)
      Removes the point at the specified index. If the specified index is out-of-bounds, nothing happens.
      Parameters:
      index - the index of the point to remove
    • removePoint

      void removePoint(RoutePoint point)
      Removes the specified point from the route. If the point does not belong to this route, nothing happens.
      Parameters:
      point - the point to remove
    • getName

      String getName()
      Gets the name of the route.
      Returns:
      the route name
    • saveToDisk

      void saveToDisk()
      Saves the route to disk in its current state. The resulting .yml file will automatically be loaded again when the plugin reloads.