Interface IBaritoneProcess

All Known Subinterfaces:
IBuilderProcess, ICustomGoalProcess, IElytraProcess, IExploreProcess, IFarmProcess, IFollowProcess, IGetToBlockProcess, IMineProcess

public interface IBaritoneProcess
A process that can control the PathingBehavior.

Differences between a baritone process and a behavior:

  • Only one baritone process can be active at a time
  • PathingBehavior can only be controlled by a process

That's it actually

Author:
leijurv
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    Default priority.
  • Method Summary

    Modifier and Type
    Method
    Description
    default String
    Returns a user-friendly name for this process.
     
    boolean
    Would this process like to be in control?
    boolean
    Returns whether or not this process should be treated as "temporary".
    void
    Called if isActive() returned true, but another non-temporary process has control.
    onTick(boolean calcFailed, boolean isSafeToCancel)
    Called when this process is in control of pathing; Returns what Baritone should do.
    default double
    Used to determine which Process gains control if multiple are reporting isActive().
  • Field Details

    • DEFAULT_PRIORITY

      static final double DEFAULT_PRIORITY
      Default priority. Most normal processes should have this value.

      Some examples of processes that should have different values might include some kind of automated mob avoidance that would be temporary and would forcefully take control. Same for something that pauses pathing for auto eat, etc.

      The value is -1 beacuse that's what Impact 4.5's beta auto walk returns and I want to tie with it.

      See Also:
  • Method Details

    • isActive

      boolean isActive()
      Would this process like to be in control?
      Returns:
      Whether or not this process would like to be in contorl.
    • onTick

      PathingCommand onTick(boolean calcFailed, boolean isSafeToCancel)
      Called when this process is in control of pathing; Returns what Baritone should do.
      Parameters:
      calcFailed - true if this specific process was in control last tick, and there was a PathEvent.CALC_FAILED event last tick
      isSafeToCancel - true if a PathingCommandType.REQUEST_PAUSE would happen this tick, and IPathingBehavior wouldn't actually tick. false if the PathExecutor reported pausing would be unsafe at the end of the last tick. Effectively "could request cancel or pause and have it happen right away"
      Returns:
      What the IPathingBehavior should do
    • isTemporary

      boolean isTemporary()
      Returns whether or not this process should be treated as "temporary".

      If a process is temporary, it doesn't call onLostControl() on the processes that aren't execute because of it.

      For example, CombatPauserProcess and PauseForAutoEatProcess should return true always, and should return isActive() true only if there's something in range this tick, or if the player would like to start eating this tick. PauseForAutoEatProcess should only actually right click once onTick is called with isSafeToCancel true though.

      Returns:
      Whether or not if this control is temporary
    • onLostControl

      Called if isActive() returned true, but another non-temporary process has control. Effectively the same as cancel. You want control but you don't get it.
    • priority

      default double priority()
      Used to determine which Process gains control if multiple are reporting isActive(). The one that returns the highest value will be given control.
      Returns:
      A double representing the priority
    • displayName

      default String displayName()
      Returns a user-friendly name for this process. Suitable for a HUD.
      Returns:
      A display name that's suitable for a HUD
    • displayName0