Class PathManager
java.lang.Object
com.chiefminingdad.autoplayer.pathmanager.PathManager
Manages the logic for all the pathfinding so that most of the logic is in one place and easier to read.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPathManager(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 TypeMethodDescriptionnet.minecraft.client.Minecraftnet.minecraft.world.entity.player.Playervoidrun()Runs one round of expanding the path.voidupdateStartLocation(net.minecraft.core.Vec3i newStartingLocation) Used when the circumstances the pathfinding is working with changes and pathfinding has to restart.
-
Field Details
-
nodeManager
-
endLocation
public net.minecraft.core.Vec3i endLocation -
Path
-
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.
-