Class RegionIntersection

All Implemented Interfaces:
IBatchProcessor, Region, Cloneable, Iterable<BlockVector3>, Collection<BlockVector3>, Set<BlockVector3>

public class RegionIntersection extends AbstractRegion
An intersection of several other regions. Any location that is contained in one of the child regions is considered as contained by this region.

iterator() returns a special iterator that will iterate through the iterators of each region in an undefined sequence. Some positions may be repeated if the position is contained in more than one region, but this cannot be guaranteed to occur.

  • Constructor Details

    • RegionIntersection

      public RegionIntersection(List<Region> regions)
      Create a new instance with the included list of regions.
      Parameters:
      regions - a list of regions, which is copied
    • RegionIntersection

      public RegionIntersection(Region... regions)
      Create a new instance with the included list of regions.
      Parameters:
      regions - a list of regions, which is copied
    • RegionIntersection

      public RegionIntersection(World world, Collection<Region> regions)
      Create a new instance with the included list of regions.
      Parameters:
      world - the world
      regions - a list of regions, which is copied
    • RegionIntersection

      public RegionIntersection(World world, Region... regions)
      Create a new instance with the included list of regions.
      Parameters:
      world - the world
      regions - an array of regions, which is copied
  • Method Details

    • getMinimumPoint

      public BlockVector3 getMinimumPoint()
      Description copied from interface: Region
      Get the lower point of a region.
      Returns:
      min. point
    • getMaximumPoint

      public BlockVector3 getMaximumPoint()
      Description copied from interface: Region
      Get the upper point of a region.
      Returns:
      max. point
    • expand

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

      public void contract(BlockVector3... changes) throws RegionOperationException
      Description copied from interface: Region
      Contract the region.
      Parameters:
      changes - array/arguments with multiple related changes
      Throws:
      RegionOperationException - if the operation cannot be performed
    • contains

      public boolean contains(BlockVector3 position)
      Description copied from interface: Region
      Returns true based on whether the region contains the point.
      Parameters:
      position - the position
      Returns:
      true if contained
    • iterator

      public Iterator<BlockVector3> iterator()
      Description copied from class: AbstractRegion
      Get the iterator.
      Specified by:
      iterator in interface Collection<BlockVector3>
      Specified by:
      iterator in interface Iterable<BlockVector3>
      Specified by:
      iterator in interface Set<BlockVector3>
      Overrides:
      iterator in class AbstractRegion
      Returns:
      iterator of points inside the region
    • containsEntireCuboid

      public boolean containsEntireCuboid(int bx, int tx, int by, int ty, int bz, int tz)
    • processSet

      public IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set)
      Description copied from interface: IBatchProcessor
      Process a chunk that has been set.
    • postProcessSet

      public Future<?> postProcessSet(IChunk chunk, IChunkGet get, IChunkSet set)
      Description copied from interface: IBatchProcessor
      Post-process a chunk that has been edited. Set should NOT be modified here, changes will NOT be flushed to the world, but MAY be flushed to history. Defaults to nothing as most Processors will not use it. Post-processors that are not technically blocking should override this method to allow post-processors to become blocking if required.
    • processSet

      public IChunkSet processSet(IChunk chunk, IChunkGet get, IChunkSet set, boolean asBlacklist)
      Description copied from interface: Region
      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.
      asBlacklist - If any blocks contained by the region should be removed
    • getRegions

      public List<Region> getRegions()
    • getChunks

      public Set<BlockVector2> getChunks()
      Description copied from class: AbstractRegion
      Get a list of chunks.
      Specified by:
      getChunks in interface Region
      Overrides:
      getChunks in class AbstractRegion
      Returns:
      a set of chunks
    • getChunkCubes

      public Set<BlockVector3> getChunkCubes()
      Description copied from interface: Region
      Return a list of 16*16*16 chunks in a region.
      Specified by:
      getChunkCubes in interface Region
      Overrides:
      getChunkCubes in class AbstractRegion
      Returns:
      the chunk cubes this region overlaps with
    • containsChunk

      public boolean containsChunk(int chunkX, int chunkZ)
    • contains

      public boolean contains(int x, int z)
    • contains

      public boolean contains(int x, int y, int z)