Class OffsetsMask2D.Builder

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

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

    • mask

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

      public OffsetsMask2D.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 OffsetsMask2D.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 OffsetsMask2D.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 OffsetsMask2D.Builder offsets(Iterable<BlockVector2> offsets)
      Set the offsets to test. Defaults to all cardinal directions.
      Parameters:
      offsets - the offsets to test
      Returns:
      this builder, for chaining
    • build

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