Class ForwardExtentCopy

java.lang.Object
com.sk89q.worldedit.function.operation.ForwardExtentCopy
All Implemented Interfaces:
Operation

public class ForwardExtentCopy extends Object implements 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.

  • Constructor Details

    • ForwardExtentCopy

      public ForwardExtentCopy(Extent source, Region region, Extent destination, BlockVector3 to)
      Create a new copy using the region's lowest minimum point as the "from" position.
      Parameters:
      source - the source extent
      region - the region to copy
      destination - the destination extent
      to - 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 extent
      region - the region to copy
      from - the source position
      destination - the destination extent
      to - the destination position
  • Method Details

    • getTransform

      public Transform getTransform()
      Get the transformation that will occur on every point.

      The transformation will stack with each repetition.

      Returns:
      a transformation
    • setTransform

      public void setTransform(Transform transform)
      Set the transformation that will occur on every point.
      Parameters:
      transform - a transformation
      See Also:
    • getSourceMask

      public Mask 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

      public void setSourceMask(Mask sourceMask)
      Set a mask that gets applied to the source extent.
      Parameters:
      sourceMask - a source mask
      See Also:
    • getSourceFunction

      public RegionFunction 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

      public void setSourceFunction(RegionFunction function)
      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

      public Operation resume(RunContext run) throws WorldEditException
      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 interface Operation
      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.
      Specified by:
      cancel in interface Operation
    • getStatusMessages

      public Iterable<com.sk89q.worldedit.util.formatting.text.Component> getStatusMessages()
      Description copied from interface: Operation
      Gets an iterable of messages that describe the current status of the operation.
      Specified by:
      getStatusMessages in interface Operation
      Returns:
      The status messages