Package net.paulem.arcana.utils
Class LocationUtils
java.lang.Object
net.paulem.arcana.utils.LocationUtils
Utility methods for working with locations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic org.bukkit.Location[]getIntermediary(org.bukkit.Location base, org.bukkit.Location end, double stepsInterval) Computes a series of locations betweenbaseandend, evenly spaced along the Y axis bystepsIntervalblocks.
-
Constructor Details
-
LocationUtils
public LocationUtils()
-
-
Method Details
-
getIntermediary
public static org.bukkit.Location[] getIntermediary(org.bukkit.Location base, org.bukkit.Location end, double stepsInterval) Computes a series of locations betweenbaseandend, evenly spaced along the Y axis bystepsIntervalblocks. The X and Z coordinates ofbaseare kept for every intermediary location. Works whetherendis above or belowbase: the step direction is chosen based on the sign of the Y difference, and the number of steps is derived from the absolute Y distance divided bystepsInterval, rounded up. The returned array always starts atbase's Y and ends at or pastend's Y.- Parameters:
base- the starting locationend- the ending locationstepsInterval- the vertical distance, in blocks, between each intermediary location- Returns:
- an array of locations from
basetoend, spaced bystepsIntervalon the Y axis
-