public class RequestSelection extends java.lang.Object implements Region
LocalSession
and World
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(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.
|
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.
|
protected Region |
getRegion()
Get the delegate region.
|
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.Iterator<BlockVector3> |
iterator() |
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.
|
protected Region getRegion()
public BlockVector3 getMinimumPoint()
Region
getMinimumPoint
in interface Region
public BlockVector3 getMaximumPoint()
Region
getMaximumPoint
in interface Region
public Vector3 getCenter()
Region
public long getVolume()
Region
Note: This method must be overridden.
public int getWidth()
Region
public int getHeight()
Region
public int getLength()
Region
public void expand(BlockVector3... changes) throws RegionOperationException
Region
expand
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
public void contract(BlockVector3... changes) throws RegionOperationException
Region
contract
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
public void shift(BlockVector3 change) throws RegionOperationException
Region
shift
in interface Region
change
- the changeRegionOperationException
public boolean contains(BlockVector3 position)
Region
public java.util.Set<BlockVector2> getChunks()
Region
public java.util.Set<BlockVector3> getChunkCubes()
Region
getChunkCubes
in interface Region
public World getWorld()
Region
public void setWorld(World world)
Region
public java.util.List<BlockVector2> polygonize(int maxPoints)
Region
polygonize
in interface Region
maxPoints
- maximum number of points to generate. -1 for no limit.public java.util.Iterator<BlockVector3> iterator()
iterator
in interface java.lang.Iterable<BlockVector3>