Package dev.sefiraat.sefilib.world
Class LocationUtils
java.lang.Object
dev.sefiraat.sefilib.world.LocationUtils
This class contains static methods for dealing with locations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic LocationReturns a location in the centre of a block at the given location.static LocationrandomLocation(Location centreLocation, int range) Picks a random location within a given range around a pointstatic LocationrandomLocation(Location centreLocation, int rangeX, int rangeY, int rangeZ) Picks a random location within a given range around a point
-
Method Details
-
randomLocation
Picks a random location within a given range around a point -
randomLocation
@Nonnull public static Location randomLocation(@Nonnull Location centreLocation, int rangeX, int rangeY, int rangeZ) Picks a random location within a given range around a point- Parameters:
centreLocation- TheLocationwhich acts as the centre of the random checkrangeX- The range in blocks in which to spread out from on the X axisrangeY- The range in blocks in which to spread out from on the Y axisrangeZ- The range in blocks in which to spread out from on the Z axis- Returns:
- The
Locationrandomly selected
-
centre
Returns a location in the centre of a block at the given location.- Parameters:
location- The location to centre on.- Returns:
- The centre location.
-