public class CylinderRegion extends AbstractRegion implements FlatRegion
world
Constructor and Description |
---|
CylinderRegion()
Construct the region.
|
CylinderRegion(BlockVector3 center,
Vector2 radius,
int minY,
int maxY)
Construct the region.
|
CylinderRegion(CylinderRegion region) |
CylinderRegion(World world)
Construct the region.
|
CylinderRegion(World world,
BlockVector3 center,
Vector2 radius,
int minY,
int maxY)
Construct the region.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<BlockVector2> |
asFlatRegion()
Get this region as an iterable flat region.
|
CylinderRegion |
clone()
Make a clone of the region.
|
boolean |
contains(BlockVector3 position)
Checks to see if a point is inside this region.
|
void |
contract(BlockVector3... changes)
Contract the region.
|
static CylinderRegion |
createRadius(Extent extent,
BlockVector3 center,
double radius)
Return a new instance with the given center and radius in the X and Z
axes with a Y that extends from the bottom of the extent to the top
of the extent.
|
void |
expand(BlockVector3... changes)
Expand the region.
|
void |
extendRadius(Vector2 minRadius)
Extends the radius to be at least the given radius.
|
Vector3 |
getCenter()
Get the center point of a region.
|
int |
getHeight()
Get Y-size.
|
int |
getLength()
Get Z-size.
|
BlockVector3 |
getMaximumPoint()
Get the upper point of a region.
|
int |
getMaximumY()
Gets the maximum Y value.
|
BlockVector3 |
getMinimumPoint()
Get the lower point of a region.
|
int |
getMinimumY()
Gets the minimum Y value.
|
Vector2 |
getRadius()
Returns the radius of the cylinder.
|
long |
getVolume()
Get the number of blocks in the region.
|
int |
getWidth()
Get X-size.
|
java.util.Iterator<BlockVector3> |
iterator()
Get the 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 |
setCenter(BlockVector2 center)
Sets the main center point of the region.
|
void |
setMaximumY(int y)
Se the maximum Y.
|
void |
setMinimumY(int y)
Set the minimum Y.
|
void |
setRadius(Vector2 radius)
Sets the radius of the cylinder.
|
boolean |
setY(int y)
Sets the height of the cylinder to fit the specified Y.
|
void |
shift(BlockVector3 change)
Shift the region.
|
java.lang.String |
toString() |
getChunkCubes, getChunks, getWorld, getWorldMaxY, getWorldMinY, setWorld
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
getArea, getBoundingBox, getChunkCubes, getChunks, getWorld, setWorld
public CylinderRegion()
public CylinderRegion(World world)
world
- the worldpublic CylinderRegion(World world, BlockVector3 center, Vector2 radius, int minY, int maxY)
world
- the worldcenter
- the center positionradius
- the radius along the X and Z axesminY
- the minimum Y, inclusivemaxY
- the maximum Y, inclusivepublic CylinderRegion(BlockVector3 center, Vector2 radius, int minY, int maxY)
center
- the center positionradius
- the radius along the X and Z axesminY
- the minimum Y, inclusivemaxY
- the maximum Y, inclusivepublic CylinderRegion(CylinderRegion region)
public Vector3 getCenter()
Region
getCenter
in interface Region
getCenter
in class AbstractRegion
public void setCenter(BlockVector2 center)
center
- the center pointpublic Vector2 getRadius()
public void setRadius(Vector2 radius)
radius
- the radius along the X and Z axespublic void extendRadius(Vector2 minRadius)
minRadius
- the minimum radiuspublic void setMinimumY(int y)
y
- the ypublic void setMaximumY(int y)
y
- the ypublic BlockVector3 getMinimumPoint()
Region
getMinimumPoint
in interface Region
public BlockVector3 getMaximumPoint()
Region
getMaximumPoint
in interface Region
public int getMaximumY()
FlatRegion
getMaximumY
in interface FlatRegion
public int getMinimumY()
FlatRegion
getMinimumY
in interface FlatRegion
public long getVolume()
Region
getVolume
in interface Region
getVolume
in class AbstractRegion
public int getWidth()
AbstractRegion
getWidth
in interface Region
getWidth
in class AbstractRegion
public int getHeight()
AbstractRegion
getHeight
in interface Region
getHeight
in class AbstractRegion
public int getLength()
AbstractRegion
getLength
in interface Region
getLength
in class AbstractRegion
public void expand(BlockVector3... changes) throws RegionOperationException
Region
expand
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
- if the operation cannot be performedpublic void contract(BlockVector3... changes) throws RegionOperationException
Region
contract
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
- if the operation cannot be performedpublic void shift(BlockVector3 change) throws RegionOperationException
Region
shift
in interface Region
shift
in class AbstractRegion
change
- the changeRegionOperationException
- if the operation cannot be performedpublic boolean contains(BlockVector3 position)
public boolean setY(int y)
y
- the y valuepublic java.util.Iterator<BlockVector3> iterator()
AbstractRegion
iterator
in interface java.lang.Iterable<BlockVector3>
iterator
in class AbstractRegion
public java.lang.Iterable<BlockVector2> asFlatRegion()
FlatRegion
asFlatRegion
in interface FlatRegion
public java.lang.String toString()
toString
in class java.lang.Object
public CylinderRegion clone()
Region
clone
in interface Region
clone
in class AbstractRegion
public java.util.List<BlockVector2> polygonize(int maxPoints)
Region
polygonize
in interface Region
polygonize
in class AbstractRegion
maxPoints
- maximum number of points to generate. -1 for no limit.public static CylinderRegion createRadius(Extent extent, BlockVector3 center, double radius)
extent
- the extentcenter
- the center positionradius
- the radius in the X and Z axes