Class GoalInverted

java.lang.Object
baritone.api.pathing.goals.GoalInverted
All Implemented Interfaces:
Goal

public class GoalInverted extends Object implements Goal
Invert any goal.

In the old chat control system, #invert just tried to pick a GoalRunAway that effectively inverted the current goal. This goal just reverses the heuristic to act as a TRUE invert. Inverting a Y level? Baritone tries to get away from that Y level. Inverting a GoalBlock? Baritone will try to make distance whether it's in the X, Y or Z directions. And of course, you can always invert a GoalXZ.

Author:
LoganDark
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    final Goal
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    int
     
    double
    Returns the heuristic at the goal.
    double
    heuristic(int x, int y, int z)
    Estimate the number of ticks it will take to get to the goal
    boolean
    isInGoal(int x, int y, int z)
    Returns whether or not the specified position meets the requirement for this goal based.
     

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait

    Methods inherited from interface baritone.api.pathing.goals.Goal

    heuristic, isInGoal
  • Field Details

  • Constructor Details

  • Method Details

    • isInGoal

      public boolean isInGoal(int x, int y, int z)
      Description copied from interface: Goal
      Returns whether or not the specified position meets the requirement for this goal based.
      Specified by:
      isInGoal in interface Goal
      Parameters:
      x - The goal X position
      y - The goal Y position
      z - The goal Z position
      Returns:
      Whether or not it satisfies this goal
    • heuristic

      public double heuristic(int x, int y, int z)
      Description copied from interface: Goal
      Estimate the number of ticks it will take to get to the goal
      Specified by:
      heuristic in interface Goal
      Parameters:
      x - The goal X position
      y - The goal Y position
      z - The goal Z position
      Returns:
      The estimate number of ticks to satisfy the goal
    • heuristic

      public double heuristic()
      Description copied from interface: Goal
      Returns the heuristic at the goal. i.e. heuristic() == heuristic(x,y,z) when isInGoal(x,y,z) == true This is needed by PathingBehavior#estimatedTicksToGoal because some Goals actually do not have a heuristic of 0 when that condition is met
      Specified by:
      heuristic in interface Goal
      Returns:
      The estimate number of ticks to satisfy the goal when the goal is already satisfied
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object