Class TransformRegion

java.lang.Object
com.sk89q.worldedit.regions.AbstractRegion
com.sk89q.worldedit.regions.TransformRegion
All Implemented Interfaces:
Region, Cloneable, Iterable<BlockVector3>

public class TransformRegion extends AbstractRegion
Transforms another region according to a provided vector Transform.
See Also:
  • Constructor Details

    • TransformRegion

      public TransformRegion(Region region, Transform transform)
      Create a new instance.
      Parameters:
      region - the region
      transform - the transform
    • TransformRegion

      public TransformRegion(@Nullable World world, Region region, Transform transform)
      Create a new instance.
      Parameters:
      world - the world, which may be null
      region - the region
      transform - the transform
  • Method Details

    • getRegion

      public Region getRegion()
      Get the untransformed, base region.
      Returns:
      the base region
    • getTransform

      public Transform getTransform()
      Get the transform that is applied.
      Returns:
      the transform
    • setTransform

      public void setTransform(Transform transform)
      Set the transform that is applied.
      Parameters:
      transform - the transform
    • 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
    • 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
      Overrides:
      getCenter in class AbstractRegion
      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
      Overrides:
      getVolume in class AbstractRegion
      Returns:
      number of blocks
    • getWidth

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

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

      public int getLength()
      Description copied from class: AbstractRegion
      Get Z-size.
      Specified by:
      getLength in interface Region
      Overrides:
      getLength in class AbstractRegion
      Returns:
      length
    • 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
    • shift

      public void shift(BlockVector3 change) throws RegionOperationException
      Description copied from interface: Region
      Shift the region.
      Specified by:
      shift in interface Region
      Overrides:
      shift in class AbstractRegion
      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.
      Parameters:
      position - the position
      Returns:
      true if contained
    • 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
      Overrides:
      polygonize in class AbstractRegion
      Parameters:
      maxPoints - maximum number of points to generate. -1 for no limit.
      Returns:
      the points.
    • 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