Class RegionIntersection

java.lang.Object
com.sk89q.worldedit.regions.AbstractRegion
com.sk89q.worldedit.regions.RegionIntersection
All Implemented Interfaces:
Region, Cloneable, Iterable<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, List<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 Iterable<BlockVector3>
      Overrides:
      iterator in class AbstractRegion
      Returns:
      iterator of points inside the region