Class DirectionalVisitor

All Implemented Interfaces:
Operation

public class DirectionalVisitor extends RecursiveVisitor
Visits adjacent points on the same X-Z plane as long as the points pass the given mask, and then executes the provided region function on the entire column.

This is used by //fill.

  • Constructor Details

    • DirectionalVisitor

      public DirectionalVisitor(Mask mask, RegionFunction function, BlockVector3 origin, BlockVector3 direction, int distance, int minY, int maxY)
      New visitor. Only visits in the given direction
      Parameters:
      mask - block mask
      function - function to apply
      origin - start position
      direction - allowable direction to visit between
      distance - max number of iterations
      minY - min visitable y value. Inclusive.
      maxY - max visitable y value. Inclusive.
  • Method Details

    • isVisitable

      public boolean isVisitable(BlockVector3 from, BlockVector3 to)
      Description copied from class: BreadthFirstSearch
      Return whether the given 'to' block should be visited, starting from the 'from' block.
      Overrides:
      isVisitable in class RecursiveVisitor
      Parameters:
      from - the origin block
      to - the block under question
      Returns:
      true if the 'to' block should be visited