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 ExtentConvert this processor into an Extent based processor instead of a queue batch based on.default booleancontains(int x, int z) default booleancontains(int x, int y, int z) booleancontains(BlockVector3 position) Returns true based on whether the region contains the point.default booleancontainsChunk(int chunkX, int chunkZ) Returns whether this region intersects with the AABB of the given chunk.default booleancontainsEntireCuboid(int bx, int tx, int by, int ty, int bz, int tz) voidcontract(BlockVector3... changes) Contract the region.voidexpand(BlockVector3... changes) Expand the region.default voidfilter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, boolean full) default voidfilter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, boolean full) default voidfilter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int minY, int maxY, boolean full) default voidfilter(IChunk chunk, Filter filter, ChunkFilterBlock block, IChunkGet get, IChunkSet set, int layer, int yStart, int yEnd, boolean full) default voidfilter(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 intgetArea()Deprecated.default CuboidRegionGet the bounding box of this region as aCuboidRegion.default Vector3Get the center point of a region.Return a list of 16*16*16 chunks in a region.Get a list of chunks.default BlockVector3intGet Y-size.intGet Z-size.Get the upper point of a region.default intGet the lower point of a region.default intdefault ProcessorScopegetScope()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 longGet the number of blocks in the region.intgetWidth()Get X-size.getWorld()Sets the world that the selection is in.default booleanisGlobal()polygonize(int maxPoints) Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.default IChunkSetprocessSet(IChunk chunk, IChunkGet get, IChunkSet set) Process a chunk that has been set.default IChunkSetprocessSet(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.voidSets the world that the selection is in.voidshift(BlockVector3 change) Shift the region.Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
flush, join, joinPost, postProcess, postProcessSet, processGet, processGet, remove, trimNBT, trimNBT, trimYMethods 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) Returns whether this region intersects with the AABB of the given chunk.- Returns:
- whether this region intersects with the AABB of the given chunk
-
processSet
Description copied from interface:IBatchProcessorProcess a chunk that has been set.- Specified by:
processSetin 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:IBatchProcessorConvert this processor into an Extent based processor instead of a queue batch based on.- Specified by:
constructin interfaceIBatchProcessor
-
getScope
Description copied from interface:IBatchProcessorDefault 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:
getScopein interfaceIBatchProcessor
-
getVolume()to prevent overflows