Class OffsetsMask2D

java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask2D
com.sk89q.worldedit.function.mask.OffsetsMask2D
All Implemented Interfaces:
Mask2D

public class OffsetsMask2D extends AbstractMask2D
Checks whether any face of the given offsets to a block match a given mask.
  • Method Details

    • single

      public static OffsetsMask2D single(Mask2D mask, BlockVector2 offset)
      Create an offsets mask for a single offset.
      Parameters:
      mask - the mask to use
      offset - the offset
      Returns:
      the new offsets mask
    • builder

      public static OffsetsMask2D.Builder builder(Mask2D mask)
      Create a new builder, using the given mask.
      Parameters:
      mask - the mask to use
      Returns:
      the builder
    • getMask

      public Mask2D getMask()
      Get the mask.
      Returns:
      the mask
    • getExcludeSelf

      public boolean getExcludeSelf()
      Get the flag determining if matching the current block should fail the mask.
      Returns:
      if it should exclude self-matches
    • getMinMatches

      public int getMinMatches()
      Gets the minimum number of matches to pass.
      Returns:
      the minimum number of matches
    • getMaxMatches

      public int getMaxMatches()
      Gets the maximum number of matches to pass.
      Returns:
      the maximum number of matches
    • getOffsets

      public com.google.common.collect.ImmutableSet<BlockVector2> getOffsets()
      Get the offsets.
      Returns:
      the offsets
    • test

      public boolean test(BlockVector2 vector)
      Description copied from interface: Mask2D
      Returns true if the criteria is met.
      Parameters:
      vector - the vector to test
      Returns:
      true if the criteria is met