Class OffsetsMask

java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.OffsetsMask
All Implemented Interfaces:
Mask

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

    • single

      public static OffsetsMask single(Mask mask, BlockVector3 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 OffsetsMask.Builder builder(Mask mask)
      Create a new builder, using the given mask.
      Parameters:
      mask - the mask to use
      Returns:
      the builder
    • getMask

      public Mask 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<BlockVector3> getOffsets()
      Get the offsets.
      Returns:
      the offsets
    • test

      public boolean test(BlockVector3 vector)
      Description copied from interface: Mask
      Returns true if the criteria is met.
      Parameters:
      vector - the vector to test
      Returns:
      true if the criteria is met
    • toMask2D

      @Nullable public Mask2D toMask2D()
      Description copied from interface: Mask
      Get the 2D version of this mask if one exists.
      Returns:
      a 2D mask version or null if this mask can't be 2D