public interface Region extends java.lang.Iterable<BlockVector3>, java.lang.Cloneable
Modifier and Type | Method and Description |
---|---|
Region |
clone()
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.
use
getVolume() to prevent overflows |
default CuboidRegion |
getBoundingBox()
Get the bounding box of this region as a
CuboidRegion . |
Vector3 |
getCenter()
Get the center point of a region.
|
java.util.Set<BlockVector3> |
getChunkCubes()
Return a list of 16*16*16 chunks in a region.
|
java.util.Set<BlockVector2> |
getChunks()
Get a list of chunks.
|
int |
getHeight()
Get Y-size.
|
int |
getLength()
Get Z-size.
|
BlockVector3 |
getMaximumPoint()
Get the upper point of a region.
|
BlockVector3 |
getMinimumPoint()
Get the lower point of a region.
|
default long |
getVolume()
Get the number of blocks in the region.
|
int |
getWidth()
Get X-size.
|
World |
getWorld()
Sets the world that the selection is in.
|
java.util.List<BlockVector2> |
polygonize(int maxPoints)
Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.
|
void |
setWorld(World world)
Sets the world that the selection is in.
|
void |
shift(BlockVector3 change)
Shift the region.
|
BlockVector3 getMinimumPoint()
BlockVector3 getMaximumPoint()
default CuboidRegion getBoundingBox()
CuboidRegion
.Vector3 getCenter()
@Deprecated default int getArea()
getVolume()
to prevent overflows@NonAbstractForCompatibility(delegateName="getArea", delegateParams={}) default long getVolume()
NonAbstractForCompatibility
for detailsint getWidth()
int getHeight()
int getLength()
void expand(BlockVector3... changes) throws RegionOperationException
changes
- array/arguments with multiple related changesRegionOperationException
- if the operation cannot be performedvoid contract(BlockVector3... changes) throws RegionOperationException
changes
- array/arguments with multiple related changesRegionOperationException
- if the operation cannot be performedvoid shift(BlockVector3 change) throws RegionOperationException
change
- the changeRegionOperationException
- if the operation cannot be performedboolean contains(BlockVector3 position)
position
- the positionjava.util.Set<BlockVector2> getChunks()
java.util.Set<BlockVector3> getChunkCubes()
@Nullable World getWorld()
void setWorld(@Nullable World world)
world
- the world, which may be nullRegion clone()
java.util.List<BlockVector2> polygonize(int maxPoints)
maxPoints
- maximum number of points to generate. -1 for no limit.