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

public interface Region extends Iterable<BlockVector3>, Cloneable, IBatchProcessor
Represents a physical shape.
  • 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

      default BlockVector3 getDimensions()
    • getCenter

      default Vector3 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 default int getArea()
      Deprecated.
      use getVolume() to prevent overflows
      Get the number of blocks in the region.
      Returns:
      number of blocks
    • getVolume

      @NonAbstractForCompatibility(delegateName="getArea", delegateParams={}) default long 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

      void expand(BlockVector3... changes) throws RegionOperationException
      Expand the region.
      Parameters:
      changes - array/arguments with multiple related changes
      Throws:
      RegionOperationException - if the operation cannot be performed
    • contract

      void contract(BlockVector3... changes) throws RegionOperationException
      Contract the region.
      Parameters:
      changes - array/arguments with multiple related changes
      Throws:
      RegionOperationException - if the operation cannot be performed
    • shift

      void shift(BlockVector3 change) throws RegionOperationException
      Shift the region.
      Parameters:
      change - the change
      Throws:
      RegionOperationException - if the operation cannot be performed
    • contains

      boolean contains(BlockVector3 position)
      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

      @Nullable World getWorld()
      Sets the world that the selection is in.
      Returns:
      the world, or null
    • setWorld

      void setWorld(@Nullable World world)
      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

      List<BlockVector2> polygonize(int maxPoints)
      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

      default IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set)
      Description copied from interface: IBatchProcessor
      Process a chunk that has been set.
      Specified by:
      processSet in interface IBatchProcessor
    • processSet

      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.
      Parameters:
      asBlacklist - If any blocks contained by the region should be removed
    • construct

      default Extent construct(Extent child)
      Description copied from interface: IBatchProcessor
      Convert this processor into an Extent based processor instead of a queue batch based on.
      Specified by:
      construct in interface IBatchProcessor
    • getScope

      default ProcessorScope 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 interface IBatchProcessor