Package com.sk89q.worldedit.regions
Class TransformRegion
java.lang.Object
java.util.AbstractCollection<BlockVector3>
java.util.AbstractSet<BlockVector3>
com.sk89q.worldedit.regions.AbstractRegion
com.sk89q.worldedit.regions.TransformRegion
- All Implemented Interfaces:
IBatchProcessor
,Region
,Cloneable
,Iterable<BlockVector3>
,Collection<BlockVector3>
,Set<BlockVector3>
Transforms another region according to a provided vector
Transform
.- See Also:
-
Field Summary
Fields inherited from class com.sk89q.worldedit.regions.AbstractRegion
world
-
Constructor Summary
ConstructorDescriptionTransformRegion
(Region region, Transform transform) Create a new instance.TransformRegion
(World world, Region region, Transform transform) Create a new instance. -
Method Summary
Modifier and TypeMethodDescriptionboolean
contains
(BlockVector3 position) Returns true based on whether the region contains the point.void
contract
(BlockVector3... changes) Contract the region.void
expand
(BlockVector3... changes) Expand the region.Get the center point of a region.int
Get Y-size.int
Get Z-size.Get the upper point of a region.Get the lower point of a region.Get the untransformed, base region.Get the transform that is applied.long
Get the number of blocks in the region.int
getWidth()
Get X-size.iterator()
Get the iterator.polygonize
(int maxPoints) Polygonizes a cross-section or a 2D projection of the region orthogonal to the Y axis.void
setTransform
(Transform transform) Set the transform that is applied.void
shift
(BlockVector3 change) Shift the region.Methods inherited from class com.sk89q.worldedit.regions.AbstractRegion
clone, equals, getChunkCubes, getChunks, getWorld, getWorldMaxY, getWorldMinY, hashCode, setWorld, size
Methods inherited from class java.util.AbstractSet
removeAll
Methods inherited from class java.util.AbstractCollection
add, addAll, clear, contains, containsAll, isEmpty, remove, retainAll, toArray, toArray, toString
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.util.Collection
parallelStream, removeIf, stream, toArray
Methods inherited from interface com.fastasyncworldedit.core.queue.IBatchProcessor
flush, join, joinPost, postProcess, postProcessSet, processGet, remove, trimNBT, trimNBT, trimY
Methods inherited from interface com.sk89q.worldedit.regions.Region
construct, contains, contains, containsChunk, containsEntireCuboid, filter, filter, filter, filter, filter, getArea, getBoundingBox, getDimensions, getMaximumY, getMinimumY, getScope, isGlobal, processSet, processSet
-
Constructor Details
-
TransformRegion
Create a new instance.- Parameters:
region
- the regiontransform
- the transform
-
TransformRegion
Create a new instance.- Parameters:
world
- the world, which may be nullregion
- the regiontransform
- the transform
-
-
Method Details
-
getRegion
Get the untransformed, base region.- Returns:
- the base region
-
getTransform
Get the transform that is applied.- Returns:
- the transform
-
setTransform
Set the transform that is applied.- Parameters:
transform
- the transform
-
getMinimumPoint
Description copied from interface:Region
Get the lower point of a region.- Returns:
- min. point
-
getMaximumPoint
Description copied from interface:Region
Get the upper point of a region.- Returns:
- max. point
-
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 interfaceRegion
- Overrides:
getCenter
in classAbstractRegion
- Returns:
- center point
-
getVolume
public long getVolume()Description copied from interface:Region
Get the number of blocks in the region.- Specified by:
getVolume
in interfaceRegion
- Overrides:
getVolume
in classAbstractRegion
- Returns:
- number of blocks
-
getWidth
public int getWidth()Description copied from class:AbstractRegion
Get X-size.- Specified by:
getWidth
in interfaceRegion
- Overrides:
getWidth
in classAbstractRegion
- Returns:
- width
-
getHeight
public int getHeight()Description copied from class:AbstractRegion
Get Y-size.- Specified by:
getHeight
in interfaceRegion
- Overrides:
getHeight
in classAbstractRegion
- Returns:
- height
-
getLength
public int getLength()Description copied from class:AbstractRegion
Get Z-size.- Specified by:
getLength
in interfaceRegion
- Overrides:
getLength
in classAbstractRegion
- Returns:
- length
-
expand
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
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
Description copied from interface:Region
Shift the region.- Specified by:
shift
in interfaceRegion
- Overrides:
shift
in classAbstractRegion
- Parameters:
change
- the change- Throws:
RegionOperationException
- if the operation cannot be performed
-
contains
Description copied from interface:Region
Returns true based on whether the region contains the point.- Parameters:
position
- the position- Returns:
- true if contained
-
polygonize
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 interfaceRegion
- Overrides:
polygonize
in classAbstractRegion
- Parameters:
maxPoints
- maximum number of points to generate. -1 for no limit.- Returns:
- the points.
-
iterator
Description copied from class:AbstractRegion
Get the iterator.- Specified by:
iterator
in interfaceCollection<BlockVector3>
- Specified by:
iterator
in interfaceIterable<BlockVector3>
- Specified by:
iterator
in interfaceSet<BlockVector3>
- Overrides:
iterator
in classAbstractRegion
- Returns:
- iterator of points inside the region
-