Interface IPath


public interface IPath
Author:
leijurv, Brady
  • Method Summary

    Modifier and Type
    Method
    Description
    default IPath
    Cuts off this path at the loaded chunk border, and returns the resulting path.
    Returns the end position of this path.
     
    int
    Returns the number of nodes that were considered during calculation before this path was found.
    Returns the start position of this path.
    default int
    Returns the number of positions in this path.
    Ordered list of movements to carry out.
    All positions along the way.
    default IPath
    This path is actually going to be executed in the world.
    default void
    Performs a series of checks to ensure that the assembly of the path went as expected.
    default IPath
    staticCutoff(Goal destination)
    Cuts off this path using the min length and cutoff factor settings, and returns the resulting path.
    default double
    ticksRemainingFrom(int pathPosition)
    Returns the estimated number of ticks to complete the path from the given node index.
  • Method Details

    • movements

      Ordered list of movements to carry out. movements.get(i).getSrc() should equal positions.get(i) movements.get(i).getDest() should equal positions.get(i+1) movements.size() should equal positions.size()-1
      Returns:
      All of the movements to carry out
    • positions

      All positions along the way. Should begin with the same as getSrc and end with the same as getDest
      Returns:
      All of the positions along this path
    • postProcess

      default IPath postProcess()
      This path is actually going to be executed in the world. Do whatever additional processing is required. (as opposed to Path objects that are just constructed every frame for rendering)
      Returns:
      The result of path post processing
    • length

      default int length()
      Returns the number of positions in this path. Equivalent to positions().size().
      Returns:
      Number of positions in this path
    • getGoal

      Returns:
      The goal that this path was calculated towards
    • getNumNodesConsidered

      Returns the number of nodes that were considered during calculation before this path was found.
      Returns:
      The number of nodes that were considered before finding this path
    • getSrc

      Returns the start position of this path. This is the first element in the List that is returned by positions().
      Returns:
      The start position of this path
    • getDest

      Returns the end position of this path. This is the last element in the List that is returned by positions().
      Returns:
      The end position of this path.
    • ticksRemainingFrom

      default double ticksRemainingFrom(int pathPosition)
      Returns the estimated number of ticks to complete the path from the given node index.
      Parameters:
      pathPosition - The index of the node we're calculating from
      Returns:
      The estimated number of ticks remaining frm the given position
    • cutoffAtLoadedChunks

      Cuts off this path at the loaded chunk border, and returns the resulting path. Default implementation just returns this path, without the intended functionality.

      The argument is supposed to be a BlockStateInterface LOL LOL LOL LOL LOL

      Parameters:
      bsi - The block state lookup, highly cursed
      Returns:
      The result of this cut-off operation
    • staticCutoff

      default IPath staticCutoff(Goal destination)
      Cuts off this path using the min length and cutoff factor settings, and returns the resulting path. Default implementation just returns this path, without the intended functionality.
      Parameters:
      destination - The end goal of this path
      Returns:
      The result of this cut-off operation
      See Also:
    • sanityCheck

      default void sanityCheck()
      Performs a series of checks to ensure that the assembly of the path went as expected.