Class Masks

java.lang.Object
com.sk89q.worldedit.function.mask.Masks

public final class Masks extends Object
Various utility functions related to Mask and Mask2D.
  • Method Details

    • alwaysTrue

      public static Mask alwaysTrue()
      Return a 3D mask that always returns true.
      Returns:
      a mask
    • alwaysTrue2D

      public static Mask2D alwaysTrue2D()
      Return a 2D mask that always returns true.
      Returns:
      a mask
    • memoize

      public static Mask memoize(Mask mask)
      Memoize the given mask.

      This should not be kept around long-term for memory usage reasons. It's intended for usage within a single operation. The function is auto-closeable to make this simpler.

      Parameters:
      mask - the mask
      Returns:
      a memoized mask
    • memoize

      public static Mask2D memoize(Mask2D mask)
      Memoize the given mask.

      This should not be kept around long-term for memory usage reasons. It's intended for usage within a single operation. The function is auto-closeable to make this simpler.

      Parameters:
      mask - the mask
      Returns:
      a memoized mask
    • negate

      public static Mask negate(Mask mask)
      Negate the given mask.
      Parameters:
      mask - the mask
      Returns:
      a new mask
    • negate

      public static Mask2D negate(Mask2D mask)
      Negate the given mask.
      Parameters:
      mask - the mask
      Returns:
      a new mask
    • asMask

      public static Mask asMask(Mask2D mask)
      Return a 3-dimensional version of a 2D mask.
      Parameters:
      mask - the mask to make 3D
      Returns:
      a 3D mask