Interface Route
public interface Route
-
Method Summary
Modifier and TypeMethodDescriptioncreatePoint
(org.bukkit.Location location, RoutePointType type) Creates a new point at the specified location, and of the specified type.getName()
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
indexOf
(RoutePoint point) 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
removePoint
(RoutePoint point) Removes the specified point from the route.void
Saves the route to disk in its current state.
-
Method Details
-
createPoint
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 attype
- type of point- Returns:
- the new point
-
insertPoint
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 listlocation
- location to place point attype
- type of point- Returns:
- the new point
-
getPoint
Gets the point at the specified index in this route. If the specified index is out-of-bounds, this returnsnull
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
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
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.
-