File-By-File
PathfinderPlugin

PathfinderPlugin

A PathfinderPlugin is a piece of code that can be written to modify the behavior of the library to an extent not normally possible through regular usage of the Pathfinder API.

To load a plugin, you use Voyager.loadPlugin(PathfinderPlugin). This will load the plugin and call its onLoad(Voyager) method. You can also add plugins that load automatically every time a Voyager instance is created using Voyager.addAutoLoadPlugin(PathfinderPlugin).

This class is designed to be extended, allowing you to override its methods to inject custom logic at various points in Pathfinder's execution lifecycle.

Methods

getName()

Abstract method. Returns the name of the plugin. This can be any string you choose.

onLoad(Voyager voyager)

Called whenever the plugin is loaded by a Voyager instance.

  • voyager: The Voyager instance that loaded this plugin.

preTick(Voyager voyager)

Called before every tick of the Voyager instance.

  • voyager: The Voyager instance.

onTick(Voyager voyager)

Called immediately after every tick of the Voyager instance.

  • voyager: The Voyager instance.

postTick(Voyager voyager)

Called after a tick, and after the recording and playback managers have been ticked.

  • voyager: The Voyager instance.

preClear(Voyager voyager)

Called whenever the Voyager.clear() method is invoked, before the followers are actually cleared.

  • voyager: The Voyager instance.

onClear(Voyager voyager)

Called whenever the Voyager.clear() method is invoked, after the followers are actually cleared.

  • voyager: The Voyager instance.

onEnterZone(Voyager voyager, Zone zone)

Called whenever Pathfinder detects that the robot has entered a Zone.

  • voyager: The Voyager instance.
  • zone: The Zone that was just entered.

onExitZone(Voyager voyager, Zone zone)

Called whenever Pathfinder detects that the robot has exited a Zone.

  • voyager: The Voyager instance.
  • zone: The Zone that was just exited.

whileInsideZone(Voyager voyager, Zone zone)

Called whenever Pathfinder detects that the robot is currently inside a Zone.

  • voyager: The Voyager instance.
  • zone: The Zone that Pathfinder is currently inside.

onStartFollower(Voyager voyager, Follower follower)

Called whenever Pathfinder detects that a new Follower has started execution.

  • voyager: The Voyager instance.
  • follower: The Follower that was just started.

onFinishFollower(Voyager voyager, Follower follower)

Called whenever Pathfinder detects that a Follower has finished execution.

  • voyager: The Voyager instance.
  • follower: The Follower that has just finished.