Package com.sk89q.worldedit.regions
Interface Region
- All Superinterfaces:
Cloneable
,IBatchProcessor
,Iterable<BlockVector3>
- All Known Subinterfaces:
FlatRegion
,IDelegateRegion
- All Known Implementing Classes:
AbstractFlatRegion
,AbstractRegion
,BlockSet
,ConvexPolyhedralRegion
,CuboidRegion
,CylinderRegion
,EllipsoidRegion
,FaweMask
,FuzzyRegion
,MemBlockSet
,NullRegion
,Polygonal2DRegion
,PolyhedralRegion
,RegionIntersection
,RegionWrapper
,RequestSelection
,TransformRegion
Represents a physical shape.
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Make a clone of the region.default Extent
Convert this processor into an Extent based processor instead of a queue batch based one.default boolean
contains
(int x, int z) default boolean
contains
(int x, int y, int z) boolean
contains
(BlockVector3 position) Returns true based on whether the region contains the point.default boolean
containsChunk
(int chunkX, int chunkZ) default boolean
containsEntireCuboid
(int bx, int tx, int by, int ty, int bz, int tz) void
contract
(BlockVector3... changes) Contract the region.void
expand
(BlockVector3... changes) Expand the region.default void
filter
(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, boolean full) default void
filter
(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, boolean full) default void
filter
(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int minY, int maxY, boolean full) default void
filter
(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, int yStart, int yEnd, boolean full) default void
filter
(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean full) default int
getArea()
Deprecated.default CuboidRegion
Get the bounding box of this region as aCuboidRegion
.default Vector3
Get the center point of a region.Return a list of 16*16*16 chunks in a region.Get a list of chunks.default BlockVector3
int
Get Y-size.int
Get Z-size.Get the upper point of a region.default int
Get the lower point of a region.default int
default ProcessorScope
getScope()
Default to CUSTOM ProcessorScope as we want custom processors people add to be before we write history, but after FAWE does it's own stuff.default long
Get the number of blocks in the region.int
getWidth()
Get X-size.getWorld()
Sets the world that the selection is in.default boolean
isGlobal()
polygonize
(int maxPoints) Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.default IChunkSet
processSet
(IChunk chunk, IChunkGet get, IChunkSet set) Process a chunk that has been set.default IChunkSet
processSet
(IChunk chunk, IChunkGet get, IChunkSet set, boolean asBlacklist) Process the chunk, with the option to process as if the region is a blacklisted region, and thus any contained blocks should be removed, rather than uncontained blocks being removed.void
Sets the world that the selection is in.void
shift
(BlockVector3 change) Shift the region.Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
flush, join, joinPost, postProcess, postProcessSet, processGet, remove, trimNBT, trimNBT, trimY
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
Method Details
-
getMinimumPoint
BlockVector3 getMinimumPoint()Get the lower point of a region.- Returns:
- min. point
-
getMaximumPoint
BlockVector3 getMaximumPoint()Get the upper point of a region.- Returns:
- max. point
-
getDimensions
-
getBoundingBox
Get the bounding box of this region as aCuboidRegion
.- Returns:
- the bounding box
-
getCenter
Get the center point of a region. Note: Coordinates will not be integers if the corresponding lengths are even.- Returns:
- center point
-
getArea
Deprecated.usegetVolume()
to prevent overflowsGet the number of blocks in the region.- Returns:
- number of blocks
-
getVolume
Get the number of blocks in the region.- Returns:
- number of blocks
-
getWidth
int getWidth()Get X-size.- Returns:
- width
-
getHeight
int getHeight()Get Y-size.- Returns:
- height
-
getLength
int getLength()Get Z-size.- Returns:
- length
-
expand
Expand the region.- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
contract
Contract the region.- Parameters:
changes
- array/arguments with multiple related changes- Throws:
RegionOperationException
- if the operation cannot be performed
-
shift
Shift the region.- Parameters:
change
- the change- Throws:
RegionOperationException
- if the operation cannot be performed
-
contains
Returns true based on whether the region contains the point.- Parameters:
position
- the position- Returns:
- true if contained
-
getChunks
Set<BlockVector2> getChunks()Get a list of chunks.- Returns:
- a list of chunk coordinates
-
getChunkCubes
Set<BlockVector3> getChunkCubes()Return a list of 16*16*16 chunks in a region.- Returns:
- the chunk cubes this region overlaps with
-
getWorld
Sets the world that the selection is in.- Returns:
- the world, or null
-
setWorld
Sets the world that the selection is in.- Parameters:
world
- the world, which may be null
-
clone
Region clone()Make a clone of the region.- Returns:
- a cloned version
-
polygonize
Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.- Parameters:
maxPoints
- maximum number of points to generate. -1 for no limit.- Returns:
- the points.
-
contains
default boolean contains(int x, int y, int z) -
contains
default boolean contains(int x, int z) -
isGlobal
default boolean isGlobal() -
getMinimumY
default int getMinimumY() -
getMaximumY
default int getMaximumY() -
filter
default void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, boolean full) -
filter
default void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int minY, int maxY, boolean full) -
filter
default void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, boolean full) -
filter
default void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, int minX, int minY, int minZ, int maxX, int maxY, int maxZ, boolean full) -
filter
default void filter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, int yStart, int yEnd, boolean full) -
containsEntireCuboid
default boolean containsEntireCuboid(int bx, int tx, int by, int ty, int bz, int tz) -
containsChunk
default boolean containsChunk(int chunkX, int chunkZ) -
processSet
Description copied from interface:IBatchProcessor
Process a chunk that has been set.- Specified by:
processSet
in interfaceIBatchProcessor
-
processSet
Process the chunk, with the option to process as if the region is a blacklisted region, and thus any contained blocks should be removed, rather than uncontained blocks being removed.- Parameters:
asBlacklist
- If any blocks contained by the region should be removed
-
construct
Description copied from interface:IBatchProcessor
Convert this processor into an Extent based processor instead of a queue batch based one.- Specified by:
construct
in interfaceIBatchProcessor
-
getScope
Description copied from interface:IBatchProcessor
Default to CUSTOM ProcessorScope as we want custom processors people add to be before we write history, but after FAWE does it's own stuff.- Specified by:
getScope
in interfaceIBatchProcessor
-
getVolume()
to prevent overflows