Class ForwardExtentCopy
java.lang.Object
com.sk89q.worldedit.function.operation.ForwardExtentCopy
- All Implemented Interfaces:
Operation
Makes a copy of a portion of one extent to another extent or another point.
This is a forward extent copy, meaning that it iterates over the blocks in the source extent, and will copy as many blocks as there are in the source. Therefore, interpolation will not occur to fill in the gaps.
-
Field Summary
Fields inherited from interface com.sk89q.worldedit.function.operation.Operation
warnedDeprecatedClasses
-
Constructor Summary
ConstructorDescriptionForwardExtentCopy
(Extent source, Region region, Extent destination, BlockVector3 to) Create a new copy using the region's lowest minimum point as the "from" position.ForwardExtentCopy
(Extent source, Region region, BlockVector3 from, Extent destination, BlockVector3 to) Create a new copy. -
Method Summary
Modifier and TypeMethodDescriptionvoid
cancel()
Abort the current task.int
Get the number of affected objects.int
Get the number of repetitions left.Get the function that gets applied to all source blocks after the copy has been made.Get the mask that gets applied to the source extent.Iterable<com.sk89q.worldedit.util.formatting.text.Component>
Gets an iterable of messages that describe the current status of the operation.Get the transformation that will occur on every point.boolean
Return whether biomes should be copied along with blocks.boolean
Return whether entities should be copied along with blocks.boolean
Return whether entities that are copied should be removed.resume
(RunContext run) Complete the next step.void
setCopyingBiomes
(boolean copyingBiomes) Set whether biomes should be copies along with blocks.void
setCopyingEntities
(boolean copyingEntities) Set whether entities should be copied along with blocks.void
setRemovingEntities
(boolean removingEntities) Set whether entities that are copied should be removed.void
setRepetitions
(int repetitions) Set the number of repetitions left.void
setSourceFunction
(RegionFunction function) Set the function that gets applied to all source blocks after the copy has been made.void
setSourceMask
(Mask sourceMask) Set a mask that gets applied to the source extent.void
setTransform
(Transform transform) Set the transformation that will occur on every point.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.sk89q.worldedit.function.operation.Operation
addStatusMessages
-
Constructor Details
-
ForwardExtentCopy
Create a new copy using the region's lowest minimum point as the "from" position.- Parameters:
source
- the source extentregion
- the region to copydestination
- the destination extentto
- the destination position- See Also:
-
ForwardExtentCopy
public ForwardExtentCopy(Extent source, Region region, BlockVector3 from, Extent destination, BlockVector3 to) Create a new copy.- Parameters:
source
- the source extentregion
- the region to copyfrom
- the source positiondestination
- the destination extentto
- the destination position
-
-
Method Details
-
getTransform
Get the transformation that will occur on every point.The transformation will stack with each repetition.
- Returns:
- a transformation
-
setTransform
Set the transformation that will occur on every point.- Parameters:
transform
- a transformation- See Also:
-
getSourceMask
Get the mask that gets applied to the source extent.This mask can be used to filter what will be copied from the source.
- Returns:
- a source mask
-
setSourceMask
Set a mask that gets applied to the source extent.- Parameters:
sourceMask
- a source mask- See Also:
-
getSourceFunction
Get the function that gets applied to all source blocks after the copy has been made.- Returns:
- a source function, or null if none is to be applied
-
setSourceFunction
Set the function that gets applied to all source blocks after the copy has been made.- Parameters:
function
- a source function, or null if none is to be applied
-
getRepetitions
public int getRepetitions()Get the number of repetitions left.- Returns:
- the number of repetitions
-
setRepetitions
public void setRepetitions(int repetitions) Set the number of repetitions left.- Parameters:
repetitions
- the number of repetitions
-
isCopyingEntities
public boolean isCopyingEntities()Return whether entities should be copied along with blocks.- Returns:
- true if copying
-
setCopyingEntities
public void setCopyingEntities(boolean copyingEntities) Set whether entities should be copied along with blocks.- Parameters:
copyingEntities
- true if copying
-
isRemovingEntities
public boolean isRemovingEntities()Return whether entities that are copied should be removed.- Returns:
- true if removing
-
setRemovingEntities
public void setRemovingEntities(boolean removingEntities) Set whether entities that are copied should be removed.- Parameters:
removingEntities
- true if removing
-
isCopyingBiomes
public boolean isCopyingBiomes()Return whether biomes should be copied along with blocks.- Returns:
- true if copying biomes
-
setCopyingBiomes
public void setCopyingBiomes(boolean copyingBiomes) Set whether biomes should be copies along with blocks.- Parameters:
copyingBiomes
- true if copying
-
getAffected
public int getAffected()Get the number of affected objects.- Returns:
- the number of affected
-
resume
Description copied from interface:Operation
Complete the next step. If this method returns true, then the method may be called again in the future, or possibly never. If this method returns false, then this method should not be called again.- Specified by:
resume
in interfaceOperation
- Parameters:
run
- describes information about the current run- Returns:
- another operation to run that operation again, or null to stop
- Throws:
WorldEditException
- an error
-
cancel
public void cancel()Description copied from interface:Operation
Abort the current task. After the this method is called,Operation.resume(RunContext)
should not be called at any point in the future. This method should not be called after successful completion of the operation. This method must be called if the operation is interrupted before completion. -
getStatusMessages
Description copied from interface:Operation
Gets an iterable of messages that describe the current status of the operation.- Specified by:
getStatusMessages
in interfaceOperation
- Returns:
- The status messages
-