Package com.sk89q.worldedit.regions
Class CylinderRegion
java.lang.Object
java.util.AbstractCollection<BlockVector3>
java.util.AbstractSet<BlockVector3>
com.sk89q.worldedit.regions.AbstractRegion
com.sk89q.worldedit.regions.CylinderRegion
- All Implemented Interfaces:
IBatchProcessor
,FlatRegion
,Region
,Cloneable
,Iterable<BlockVector3>
,Collection<BlockVector3>
,Set<BlockVector3>
Represents a cylindrical region.
-
Field Summary
Fields inherited from class com.sk89q.worldedit.regions.AbstractRegion
world
-
Constructor Summary
ConstructorDescriptionConstruct 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. -
Method Summary
Modifier and TypeMethodDescriptionGet this region as an iterable flat region.clone()
Make a clone of the region.boolean
contains
(int x, int z) boolean
contains
(int x, int y, int z) Checks to see if a point is inside this region.boolean
contains
(BlockVector3 position) Returns true based on whether the region contains the point.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.void
filter
(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, boolean full) Get the center point of a region.int
Get Y-size.int
Get Z-size.Get the upper point of a region.int
Gets the maximum Y value.Get the lower point of a region.int
Gets the minimum Y value.Returns the radius of the cylinder.long
Get the number of blocks in the region.int
getWidth()
Get X-size.iterator()
Get the iterator.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
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.toString()
Returns string representation in the format.Methods inherited from class com.sk89q.worldedit.regions.AbstractRegion
equals, getChunkCubes, getChunks, getWorld, getWorldMaxY, getWorldMinY, hashCode, setWorld, size
Methods inherited from class java.util.AbstractSet
removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
flush, join, joinPost, postProcess, postProcessSet, processGet, remove, trimNBT, trimNBT, trimY
Methods inherited from interface com.sk89q.worldedit.regions.Region
construct, containsChunk, containsEntireCuboid, filter, filter, filter, filter, getArea, getBoundingBox, getChunkCubes, getChunks, getDimensions, getScope, getWorld, isGlobal, processSet, processSet, setWorld
-
Constructor Details
-
CylinderRegion
public CylinderRegion()Construct the region. -
CylinderRegion
Construct the region.- Parameters:
world
- the world
-
CylinderRegion
Construct the region.- Parameters:
world
- the worldcenter
- the center positionradius
- the radius along the X and Z axesminY
- the minimum Y, inclusivemaxY
- the maximum Y, inclusive
-
CylinderRegion
Construct the region.- Parameters:
center
- the center positionradius
- the radius along the X and Z axesminY
- the minimum Y, inclusivemaxY
- the maximum Y, inclusive
-
CylinderRegion
-
-
Method Details
-
getCenter
Description copied from interface:Region
Get the center point of a region. Note: Coordinates will not be integers if the corresponding lengths are even.- Specified by:
getCenter
in interfaceRegion
- Overrides:
getCenter
in classAbstractRegion
- Returns:
- center point
-
setCenter
Sets the main center point of the region.- Parameters:
center
- the center point
-
getRadius
Returns the radius of the cylinder.- Returns:
- the radius along the X and Z axes
-
setRadius
Sets the radius of the cylinder.- Parameters:
radius
- the radius along the X and Z axes
-
extendRadius
Extends the radius to be at least the given radius.- Parameters:
minRadius
- the minimum radius
-
setMinimumY
public void setMinimumY(int y) Set the minimum Y.- Parameters:
y
- the y
-
setMaximumY
public void setMaximumY(int y) Se the maximum Y.- Parameters:
y
- the y
-
getMinimumPoint
Description copied from interface:Region
Get the lower point of a region.- Specified by:
getMinimumPoint
in interfaceRegion
- Returns:
- min. point
-
getMaximumPoint
Description copied from interface:Region
Get the upper point of a region.- Specified by:
getMaximumPoint
in interfaceRegion
- Returns:
- max. point
-
getMaximumY
public int getMaximumY()Description copied from interface:FlatRegion
Gets the maximum Y value.- Specified by:
getMaximumY
in interfaceFlatRegion
- Specified by:
getMaximumY
in interfaceRegion
- Returns:
- the Y value
-
getMinimumY
public int getMinimumY()Description copied from interface:FlatRegion
Gets the minimum Y value.- Specified by:
getMinimumY
in interfaceFlatRegion
- Specified by:
getMinimumY
in interfaceRegion
- Returns:
- the Y value
-
getVolume
public long getVolume()Description copied from interface:Region
Get the number of blocks in the region.- Specified by:
getVolume
in interfaceRegion
- Overrides:
getVolume
in classAbstractRegion
- Returns:
- number of blocks
-
getWidth
public int getWidth()Description copied from class:AbstractRegion
Get X-size.- Specified by:
getWidth
in interfaceRegion
- Overrides:
getWidth
in classAbstractRegion
- Returns:
- width
-
getHeight
public int getHeight()Description copied from class:AbstractRegion
Get Y-size.- Specified by:
getHeight
in interfaceRegion
- Overrides:
getHeight
in classAbstractRegion
- Returns:
- height
-
getLength
public int getLength()Description copied from class:AbstractRegion
Get Z-size.- Specified by:
getLength
in interfaceRegion
- Overrides:
getLength
in classAbstractRegion
- Returns:
- length
-
expand
Expand the region. Expand the region.- Specified by:
expand
in interfaceRegion
- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
contract
Contract the region.- Specified by:
contract
in interfaceRegion
- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
shift
Description copied from interface:Region
Shift the region.- Specified by:
shift
in interfaceRegion
- Overrides:
shift
in classAbstractRegion
- Parameters:
change
- the change- Throws:
RegionOperationException
- if the operation cannot be performed
-
contains
public boolean contains(int x, int y, int z) Checks to see if a point is inside this region. -
contains
public boolean contains(int x, int z) -
contains
Description copied from interface:Region
Returns true based on whether the region contains the point. -
setY
public boolean setY(int y) Sets the height of the cylinder to fit the specified Y.- Parameters:
y
- the y value- Returns:
- true if the area was expanded
-
iterator
Description copied from class:AbstractRegion
Get the iterator.- Specified by:
iterator
in interfaceCollection<BlockVector3>
- Specified by:
iterator
in interfaceIterable<BlockVector3>
- Specified by:
iterator
in interfaceSet<BlockVector3>
- Overrides:
iterator
in classAbstractRegion
- Returns:
- iterator of points inside the region
-
asFlatRegion
Description copied from interface:FlatRegion
Get this region as an iterable flat region.- Specified by:
asFlatRegion
in interfaceFlatRegion
- Returns:
- a flat region iterable
-
toString
Returns string representation in the format. "(centerX, centerZ) - (radiusX, radiusZ) - (minY, maxY)"- Overrides:
toString
in classAbstractCollection<BlockVector3>
- Returns:
- string
-
clone
Description copied from interface:Region
Make a clone of the region.- Specified by:
clone
in interfaceRegion
- Overrides:
clone
in classAbstractRegion
- Returns:
- a cloned version
-
polygonize
Description copied from interface:Region
Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.- Specified by:
polygonize
in interfaceRegion
- Overrides:
polygonize
in classAbstractRegion
- Parameters:
maxPoints
- maximum number of points to generate. -1 for no limit.- Returns:
- the points.
-
createRadius
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.- Parameters:
extent
- the extentcenter
- the center positionradius
- the radius in the X and Z axes- Returns:
- a region
-
filter
public void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, boolean full)
-