Package com.sk89q.worldedit.regions
Interface Region
- All Superinterfaces:
Cloneable
,Iterable<BlockVector3>
- All Known Subinterfaces:
FlatRegion
- All Known Implementing Classes:
AbstractFlatRegion
,AbstractRegion
,ConvexPolyhedralRegion
,CuboidRegion
,CylinderRegion
,EllipsoidRegion
,NullRegion
,Polygonal2DRegion
,RegionIntersection
,RequestSelection
,TransformRegion
Represents a physical shape.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Make a clone of the region.boolean
contains
(BlockVector3 position) Returns true based on whether the region contains the point.void
contract
(BlockVector3... changes) Contract the region.void
expand
(BlockVector3... changes) Expand the region.default int
getArea()
Deprecated.default CuboidRegion
Get the bounding box of this region as aCuboidRegion
.Get the center point of a region.Return a list of 16*16*16 chunks in a region.Get a list of chunks.int
Get Y-size.int
Get Z-size.Get the upper point of a region.Get the lower point of a region.default long
Get the number of blocks in the region.int
getWidth()
Get X-size.getWorld()
Sets the world that the selection is in.polygonize
(int maxPoints) Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.void
Sets the world that the selection is in.void
shift
(BlockVector3 change) Shift the region.Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getMinimumPoint
BlockVector3 getMinimumPoint()Get the lower point of a region.- Returns:
- min. point
-
getMaximumPoint
BlockVector3 getMaximumPoint()Get the upper point of a region.- Returns:
- max. point
-
getBoundingBox
Get the bounding box of this region as aCuboidRegion
.- Returns:
- the bounding box
-
getCenter
Vector3 getCenter()Get the center point of a region. Note: Coordinates will not be integers if the corresponding lengths are even.- Returns:
- center point
-
getArea
Deprecated.usegetVolume()
to prevent overflowsGet the number of blocks in the region.- Returns:
- number of blocks
-
getVolume
Get the number of blocks in the region.- Returns:
- number of blocks
- API Note:
- This must be overridden by new subclasses. See
NonAbstractForCompatibility
for details
-
getWidth
int getWidth()Get X-size.- Returns:
- width
-
getHeight
int getHeight()Get Y-size.- Returns:
- height
-
getLength
int getLength()Get Z-size.- Returns:
- length
-
expand
Expand the region.- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
contract
Contract the region.- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
shift
Shift the region.- Parameters:
change
- the change- Throws:
RegionOperationException
- if the operation cannot be performed
-
contains
Returns true based on whether the region contains the point.- Parameters:
position
- the position- Returns:
- true if contained
-
getChunks
Set<BlockVector2> getChunks()Get a list of chunks.- Returns:
- a list of chunk coordinates
-
getChunkCubes
Set<BlockVector3> getChunkCubes()Return a list of 16*16*16 chunks in a region.- Returns:
- the chunk cubes this region overlaps with
-
getWorld
Sets the world that the selection is in.- Returns:
- the world, or null
-
setWorld
Sets the world that the selection is in.- Parameters:
world
- the world, which may be null
-
clone
Region clone()Make a clone of the region.- Returns:
- a cloned version
-
polygonize
Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.- Parameters:
maxPoints
- maximum number of points to generate. -1 for no limit.- Returns:
- the points.
-
getVolume()
to prevent overflows