Class MaskUnion

All Implemented Interfaces:
Mask

public class MaskUnion extends MaskIntersection
Combines several masks and requires that one or more masks return true when a certain position is tested. It serves as a logical OR operation on a list of masks.
  • Constructor Details

    • MaskUnion

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

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

    • test

      public boolean test(BlockVector3 vector)
      Description copied from interface: Mask
      Returns true if the criteria is met.
      Specified by:
      test in interface Mask
      Overrides:
      test in class MaskIntersection
      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.
      Specified by:
      toMask2D in interface Mask
      Overrides:
      toMask2D in class MaskIntersection
      Returns:
      a 2D mask version or null if this mask can't be 2D