Class FlatRegionOffset

java.lang.Object
com.sk89q.worldedit.function.util.FlatRegionOffset
All Implemented Interfaces:
FlatRegionFunction

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

    • FlatRegionOffset

      public FlatRegionOffset(BlockVector2 offset, FlatRegionFunction function)
      Create a new instance.
      Parameters:
      offset - the offset
      function - the function that is called with the offset position
  • Method Details

    • getOffset

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

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

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