Package net.glowstone.util
Class RectangularRegion
java.lang.Object
net.glowstone.util.RectangularRegion
-
Nested Class Summary
-
Constructor Summary
ConstructorDescriptionRectangularRegion
(org.bukkit.Location from, org.bukkit.Location to) Creates a new region bounded by the two opposing locations. -
Method Summary
Modifier and TypeMethodDescriptionIterable<org.bukkit.Location>
blockLocations
(RectangularRegion.IterationDirection directionX, RectangularRegion.IterationDirection directionY, RectangularRegion.IterationDirection directionZ) Returns an iterable over all block locations within the region, with the iterable's directionality determined by the given arguments.org.bukkit.Location
org.bukkit.Location
int
int
int
moveTo
(org.bukkit.Location lowCorner) Creates a new region at the given corner with the same dimensions as this region.
-
Constructor Details
-
RectangularRegion
public RectangularRegion(org.bukkit.Location from, org.bukkit.Location to) Creates a new region bounded by the two opposing locations.- Parameters:
from
- The first bounding corner.to
- The second bounding corner.
-
-
Method Details
-
moveTo
Creates a new region at the given corner with the same dimensions as this region.- Parameters:
lowCorner
- The corner to base the new region off of.- Returns:
- The new region.
-
blockLocations
public Iterable<org.bukkit.Location> blockLocations(RectangularRegion.IterationDirection directionX, RectangularRegion.IterationDirection directionY, RectangularRegion.IterationDirection directionZ) Returns an iterable over all block locations within the region, with the iterable's directionality determined by the given arguments.- Parameters:
directionX
- The direction of iteration along the X axis.directionY
- The direction of iteration along the Y axis.directionZ
- The direction of iteration along the Z axis.- Returns:
- The new iterable.
-
getLowCorner
public org.bukkit.Location getLowCorner() -
getHighCorner
public org.bukkit.Location getHighCorner() -
getWidthX
public int getWidthX() -
getWidthY
public int getWidthY() -
getWidthZ
public int getWidthZ()
-