Class RequestSelection

java.lang.Object
com.sk89q.worldedit.session.request.RequestSelection
All Implemented Interfaces:
Region, Cloneable, Iterable<BlockVector3>

public class RequestSelection extends Object implements Region
A region that mirrors the current selection according to the current LocalSession and World set on the current Request.

If a selection cannot be taken, then the selection will be assumed to be that of a NullRegion.

  • Constructor Details

    • RequestSelection

      public RequestSelection()
  • Method Details

    • getRegion

      protected Region getRegion()
      Get the delegate region.
      Returns:
      the delegate region
    • getMinimumPoint

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

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

      public Vector3 getCenter()
      Description copied from interface: Region
      Get the center point of a region. Note: Coordinates will not be integers if the corresponding lengths are even.
      Specified by:
      getCenter in interface Region
      Returns:
      center point
    • getVolume

      public long getVolume()
      Description copied from interface: Region
      Get the number of blocks in the region.
      Specified by:
      getVolume in interface Region
      Returns:
      number of blocks
    • getWidth

      public int getWidth()
      Description copied from interface: Region
      Get X-size.
      Specified by:
      getWidth in interface Region
      Returns:
      width
    • getHeight

      public int getHeight()
      Description copied from interface: Region
      Get Y-size.
      Specified by:
      getHeight in interface Region
      Returns:
      height
    • getLength

      public int getLength()
      Description copied from interface: Region
      Get Z-size.
      Specified by:
      getLength in interface Region
      Returns:
      length
    • expand

      public void expand(BlockVector3... changes) throws RegionOperationException
      Description copied from interface: Region
      Expand the region.
      Specified by:
      expand in interface 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.
      Specified by:
      contract in interface Region
      Parameters:
      changes - array/arguments with multiple related changes
      Throws:
      RegionOperationException - if the operation cannot be performed
    • shift

      public void shift(BlockVector3 change) throws RegionOperationException
      Description copied from interface: Region
      Shift the region.
      Specified by:
      shift in interface Region
      Parameters:
      change - the change
      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.
      Specified by:
      contains in interface Region
      Parameters:
      position - the position
      Returns:
      true if contained
    • getChunks

      public Set<BlockVector2> getChunks()
      Description copied from interface: Region
      Get a list of chunks.
      Specified by:
      getChunks in interface Region
      Returns:
      a list of chunk coordinates
    • 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
      Returns:
      the chunk cubes this region overlaps with
    • getWorld

      public World getWorld()
      Description copied from interface: Region
      Sets the world that the selection is in.
      Specified by:
      getWorld in interface Region
      Returns:
      the world, or null
    • setWorld

      public void setWorld(World world)
      Description copied from interface: Region
      Sets the world that the selection is in.
      Specified by:
      setWorld in interface Region
      Parameters:
      world - the world, which may be null
    • clone

      public Region clone()
      Description copied from interface: Region
      Make a clone of the region.
      Specified by:
      clone in interface Region
      Overrides:
      clone in class Object
      Returns:
      a cloned version
    • polygonize

      public List<BlockVector2> polygonize(int maxPoints)
      Description copied from interface: Region
      Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.
      Specified by:
      polygonize in interface Region
      Parameters:
      maxPoints - maximum number of points to generate. -1 for no limit.
      Returns:
      the points.
    • iterator

      public Iterator<BlockVector3> iterator()
      Specified by:
      iterator in interface Iterable<BlockVector3>