Class MaskIntersection

java.lang.Object
com.sk89q.worldedit.function.mask.AbstractMask
com.sk89q.worldedit.function.mask.MaskIntersection
All Implemented Interfaces:
Mask
Direct Known Subclasses:
MaskUnion

public class MaskIntersection extends AbstractMask
Combines several masks and requires that all masks return true when a certain position is tested. It serves as a logical AND operation on a list of masks.
  • Field Details

    • masks

      protected final Set<Mask> masks
    • masksArray

      protected Mask[] masksArray
    • defaultReturn

      protected boolean defaultReturn
  • Constructor Details

    • MaskIntersection

      public MaskIntersection(Collection<Mask> masks)
      Create a new intersection.
      Parameters:
      masks - a list of masks
    • MaskIntersection

      public MaskIntersection(Mask... mask)
      Create a new intersection.
      Parameters:
      mask - a list of masks
  • Method Details

    • of

      public static Mask of(Mask... masks)
    • pairingFunction

      public Function<Map.Entry<Mask,Mask>,Mask> pairingFunction()
    • tryOptimize

      public Mask tryOptimize()
      Description copied from interface: Mask
      Returns null if no optimization took place otherwise a new/same mask
      Returns:
    • add

      public void add(Collection<Mask> masks)
      Add some masks to the list.
      Parameters:
      masks - the masks
    • add

      public void add(Mask... mask)
      Add some masks to the list.
      Parameters:
      mask - the masks
    • getMasks

      public Collection<Mask> getMasks()
      Get the masks that are tested with.
      Returns:
      the masks
    • getMasksArray

      public final Mask[] getMasksArray()
    • 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
    • copy

      public Mask copy()
      Description copied from interface: Mask
      Returns a copy of the mask. Usually for multi-threaded operation
      Returns:
      a clone of the mask
    • replacesAir

      public boolean replacesAir()