Class RegionOffset

java.lang.Object
com.sk89q.worldedit.function.util.RegionOffset
All Implemented Interfaces:
Filter, RegionFunction

public class RegionOffset extends Object implements RegionFunction
Offsets the position parameter by adding a given offset vector.
  • Constructor Details

    • RegionOffset

      public RegionOffset(BlockVector3 offset, RegionFunction function)
      Create a new instance.
      Parameters:
      offset - the offset
      function - the function that is called with the offset position
  • Method Details

    • getOffset

      public BlockVector3 getOffset()
      Get the offset that is added to the position.
      Returns:
      the offset
    • setOffset

      public void setOffset(BlockVector3 offset)
      Set the offset that is added to the position.
      Parameters:
      offset - the offset
    • apply

      public boolean apply(BlockVector3 position) throws WorldEditException
      Description copied from interface: RegionFunction
      Apply the function to the given position.
      Specified by:
      apply in interface RegionFunction
      Parameters:
      position - the position
      Returns:
      true if something was changed
      Throws:
      WorldEditException - thrown on an error