Class BlockMask

All Implemented Interfaces:
Mask

public class BlockMask extends AbstractExtentMask
A mask that checks whether blocks at the given positions are matched by a block in a list.

This mask checks for both an exact block type and state value match, respecting fuzzy status of the BlockState.

  • Constructor Details

    • BlockMask

      public BlockMask(Extent extent, Collection<BaseBlock> blocks)
      Create a new block mask.
      Parameters:
      extent - the extent
      blocks - a list of blocks to match
    • BlockMask

      public BlockMask(Extent extent, BaseBlock... block)
      Create a new block mask.
      Parameters:
      extent - the extent
      block - an array of blocks to match
  • Method Details

    • add

      public void add(Collection<BaseBlock> blocks)
      Add the given blocks to the list of criteria.
      Parameters:
      blocks - a list of blocks
    • add

      public void add(BaseBlock... block)
      Add the given blocks to the list of criteria.
      Parameters:
      block - an array of blocks
    • getBlocks

      public Collection<BaseBlock> getBlocks()
      Get the list of blocks that are tested with.
      Returns:
      a list of blocks
    • 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