Class PathManager

java.lang.Object
com.chiefminingdad.autoplayer.pathmanager.PathManager

public class PathManager extends Object
Manages the logic for all the pathfinding so that most of the logic is in one place and easier to read.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    net.minecraft.core.Vec3i
     
     
     
     
  • Constructor Summary

    Constructors
    Constructor
    Description
    PathManager(net.minecraft.core.Vec3i finalLocation)
    Creates an instance where the starting location is the player's location.
    PathManager(net.minecraft.core.Vec3i startingLocation, net.minecraft.core.Vec3i finalLocation)
    Creates an instance where the starting location is the given.
  • Method Summary

    Modifier and Type
    Method
    Description
    net.minecraft.client.Minecraft
     
    net.minecraft.world.entity.player.Player
     
    void
    run()
    Runs one round of expanding the path.
    void
    updateStartLocation(net.minecraft.core.Vec3i newStartingLocation)
    Used when the circumstances the pathfinding is working with changes and pathfinding has to restart.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • nodeManager

      public NodeManager nodeManager
    • endLocation

      public net.minecraft.core.Vec3i endLocation
    • Path

      public Node[] Path
    • running

      public Boolean running
  • Constructor Details

    • PathManager

      public PathManager(net.minecraft.core.Vec3i startingLocation, net.minecraft.core.Vec3i finalLocation)
      Creates an instance where the starting location is the given.
      Parameters:
      startingLocation - The starting location for the algorithm.
      finalLocation - The location the algorithm will pathfind to.
    • PathManager

      public PathManager(net.minecraft.core.Vec3i finalLocation)
      Creates an instance where the starting location is the player's location.
      Parameters:
      finalLocation - The location the algorithm will pathfind to.
  • Method Details

    • getClient

      public net.minecraft.client.Minecraft getClient()
      Returns:
      The Minecraft instance if it is instantiated.
    • getPlayer

      public net.minecraft.world.entity.player.Player getPlayer()
      Returns:
      The Player instance if the game is instantiated.
    • updateStartLocation

      public void updateStartLocation(net.minecraft.core.Vec3i newStartingLocation)
      Used when the circumstances the pathfinding is working with changes and pathfinding has to restart.
      Parameters:
      newStartingLocation - the new location pathfinding will start from.
    • run

      public void run()
      Runs one round of expanding the path.