Class OffsetsMask.Builder

java.lang.Object
com.sk89q.worldedit.function.mask.OffsetsMask.Builder
Enclosing class:
OffsetsMask

public static final class OffsetsMask.Builder extends Object
A builder for an OffsetsMask.
  • Method Details

    • mask

      public OffsetsMask.Builder mask(Mask mask)
      Set the mask to test.
      Parameters:
      mask - the mask to test
      Returns:
      this builder, for chaining
    • excludeSelf

      public OffsetsMask.Builder excludeSelf(boolean excludeSelf)
      Set whether the mask should fail if the original position matches. Defaults to false.
      Parameters:
      excludeSelf - true to exclude the original position if it matches
      Returns:
      this builder, for chaining
    • minMatches

      public OffsetsMask.Builder minMatches(int minMatches)
      Set the minimum amount of matches required. Defaults to 1. Must be smaller than or equal to the max matches and the offsets size, and greater than or equal to 0.
      Parameters:
      minMatches - the minimum amount of matches required
      Returns:
      this builder, for chaining
    • maxMatches

      public OffsetsMask.Builder maxMatches(int maxMatches)
      Set the maximum amount of matches allowed. Defaults to Integer.MAX_VALUE. Must be greater than or equal to minMatches(int).
      Parameters:
      maxMatches - the maximum amount of matches allowed
      Returns:
      this builder, for chaining
    • offsets

      public OffsetsMask.Builder offsets(Iterable<BlockVector3> offsets)
      Set the offsets to test. Defaults to all cardinal and upright directions.
      Parameters:
      offsets - the offsets to test
      Returns:
      this builder, for chaining
    • build

      public OffsetsMask build()
      Build an offsets mask.
      Returns:
      the new mask