public class RequestSelection extends java.lang.Object implements Region
LocalSession
and LocalWorld
set on the current
Request
.
If a selection cannot be taken, then the selection will be assumed to be
that of a NullRegion
.
Constructor and Description |
---|
RequestSelection() |
Modifier and Type | Method and Description |
---|---|
Region |
clone()
Make a clone of the region.
|
boolean |
contains(Vector position)
Returns true based on whether the region contains the point.
|
void |
contract(Vector... changes)
Contract the region.
|
void |
expand(Vector... changes)
Expand the region.
|
int |
getArea()
Get the number of blocks in the region.
|
Vector |
getCenter()
Get the center point of a region.
|
java.util.Set<Vector> |
getChunkCubes()
Return a list of 16*16*16 chunks in a region
|
java.util.Set<Vector2D> |
getChunks()
Get a list of chunks.
|
int |
getHeight()
Get Y-size.
|
int |
getLength()
Get Z-size.
|
Vector |
getMaximumPoint()
Get the upper point of a region.
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
protected Region |
getRegion()
Get the delegate region.
|
int |
getWidth()
Get X-size.
|
World |
getWorld()
Sets the world that the selection is in.
|
java.util.Iterator<BlockVector> |
iterator() |
java.util.List<BlockVector2D> |
polygonize(int maxPoints)
Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.
|
void |
setWorld(LocalWorld world)
Sets the world that the selection is in.
|
void |
setWorld(World world)
Sets the world that the selection is in.
|
void |
shift(Vector change)
Shift the region.
|
protected Region getRegion()
public Vector getMinimumPoint()
Region
getMinimumPoint
in interface Region
public Vector getMaximumPoint()
Region
getMaximumPoint
in interface Region
public Vector getCenter()
Region
public int getArea()
Region
public int getWidth()
Region
public int getHeight()
Region
public int getLength()
Region
public void expand(Vector... changes) throws RegionOperationException
Region
expand
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
public void contract(Vector... changes) throws RegionOperationException
Region
contract
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
public void shift(Vector change) throws RegionOperationException
Region
shift
in interface Region
change
- the changeRegionOperationException
public boolean contains(Vector position)
Region
public java.util.Set<Vector2D> getChunks()
Region
public java.util.Set<Vector> getChunkCubes()
Region
getChunkCubes
in interface Region
public World getWorld()
Region
public void setWorld(LocalWorld world)
Region
public void setWorld(World world)
Region
public java.util.List<BlockVector2D> polygonize(int maxPoints)
Region
polygonize
in interface Region
maxPoints
- maximum number of points to generate. -1 for no limit.public java.util.Iterator<BlockVector> iterator()
iterator
in interface java.lang.Iterable<BlockVector>