public class CylinderRegion extends AbstractRegion implements FlatRegion
world
Constructor and Description |
---|
CylinderRegion()
Construct the region
|
CylinderRegion(CylinderRegion region) |
CylinderRegion(LocalWorld world)
Deprecated.
cast
world to World |
CylinderRegion(LocalWorld world,
Vector center,
Vector2D radius,
int minY,
int maxY)
Deprecated.
|
CylinderRegion(Vector center,
Vector2D radius,
int minY,
int maxY)
Construct the region.
|
CylinderRegion(World world)
Construct the region.
|
CylinderRegion(World world,
Vector center,
Vector2D radius,
int minY,
int maxY)
Construct the region.
|
Modifier and Type | Method and Description |
---|---|
java.lang.Iterable<Vector2D> |
asFlatRegion()
Get this region as an iterable flat region.
|
CylinderRegion |
clone()
Make a clone of the region.
|
boolean |
contains(Vector position)
Checks to see if a point is inside this region.
|
void |
contract(Vector... changes)
Contract the region.
|
static CylinderRegion |
createRadius(Extent extent,
Vector 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(Vector... changes)
Expand the region.
|
void |
extendRadius(Vector2D minRadius)
Extends the radius to be at least the given radius
|
int |
getArea()
Get the number of blocks in the region.
|
Vector |
getCenter()
Get the center point of a region.
|
int |
getHeight()
Get Y-size.
|
int |
getLength()
Get Z-size.
|
Vector |
getMaximumPoint()
Get the upper point of a region.
|
int |
getMaximumY()
Gets the maximum Y value
|
Vector |
getMinimumPoint()
Get the lower point of a region.
|
int |
getMinimumY()
Gets the minimum Y value
|
Vector2D |
getRadius()
Returns the radius of the cylinder
|
int |
getWidth()
Get X-size.
|
java.util.Iterator<BlockVector> |
iterator()
Get the 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 |
setCenter(Vector center)
Deprecated.
replaced by
setCenter(Vector2D) |
void |
setCenter(Vector2D 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(Vector2D radius)
Sets the radius of the cylinder
|
boolean |
setY(int y)
Sets the height of the cylinder to fit the specified Y.
|
void |
shift(Vector change)
Shift the region.
|
java.lang.String |
toString()
Returns string representation in the format
"(centerX, centerZ) - (radiusX, radiusZ) - (minY, maxY)"
|
getChunkCubes, getChunks, getWorld, setWorld, setWorld
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
public CylinderRegion()
@Deprecated public CylinderRegion(LocalWorld world)
world
to World
public CylinderRegion(World world)
world
- the world@Deprecated public CylinderRegion(LocalWorld world, Vector center, Vector2D radius, int minY, int maxY)
public CylinderRegion(World world, Vector center, Vector2D 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(Vector center, Vector2D 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 Vector getCenter()
Region
getCenter
in interface Region
getCenter
in class AbstractRegion
@Deprecated public void setCenter(Vector center)
setCenter(Vector2D)
public void setCenter(Vector2D center)
center
- the center pointpublic Vector2D getRadius()
public void setRadius(Vector2D radius)
radius
- the radius along the X and Z axespublic void extendRadius(Vector2D minRadius)
minRadius
- the minimum radiuspublic void setMinimumY(int y)
y
- the ypublic void setMaximumY(int y)
y
- the ypublic Vector getMinimumPoint()
Region
getMinimumPoint
in interface Region
public Vector getMaximumPoint()
Region
getMaximumPoint
in interface Region
public int getMaximumY()
FlatRegion
getMaximumY
in interface FlatRegion
public int getMinimumY()
FlatRegion
getMinimumY
in interface FlatRegion
public int getArea()
AbstractRegion
getArea
in interface Region
getArea
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(Vector... changes) throws RegionOperationException
expand
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
public void contract(Vector... changes) throws RegionOperationException
contract
in interface Region
changes
- array/arguments with multiple related changesRegionOperationException
public void shift(Vector change) throws RegionOperationException
Region
shift
in interface Region
shift
in class AbstractRegion
change
- the changeRegionOperationException
public boolean contains(Vector position)
public boolean setY(int y)
y
- the y valuepublic java.util.Iterator<BlockVector> iterator()
AbstractRegion
iterator
in interface java.lang.Iterable<BlockVector>
iterator
in class AbstractRegion
public java.lang.Iterable<Vector2D> 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<BlockVector2D> 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, Vector center, double radius)
extent
- the extentcenter
- the center positionradius
- the radius in the X and Z axes