Class PathfinderFollowOwner

java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderFollowOwner
All Implemented Interfaces:
PathfinderInfo, SpeedModifier

public final class PathfinderFollowOwner extends Pathfinder implements SpeedModifier
Represents a Pathfinder for a Tamable Animal to follow its owner
  • Constructor Details

    • PathfinderFollowOwner

      public PathfinderFollowOwner(@NotNull @NotNull Tameable t, float startDistance, float stopDistance)
      Creates a PathfinderFollowOwner with no speed modifier.
      Parameters:
      t - Tamable Entity
      startDistance - How far away from owner to start walking towards
      stopDistance - How far away from owner to stop walking towards
    • PathfinderFollowOwner

      public PathfinderFollowOwner(@NotNull @NotNull Tameable t, double speedMod, float startDistance, float stopDistance)
      Creates a PathfinderFollowOwner with flying set to true.
      Parameters:
      t - Tamable to use
      speedMod - Speed Modifier while following
      startDistance - How far away from owner to start walking towards
      stopDistance - How far away from owner to stop walking towards
    • PathfinderFollowOwner

      public PathfinderFollowOwner(@NotNull @NotNull Tameable t, double speedMod, float startDistance, float stopDistance, boolean fly)
      Creates a PathfinderFollowOwner.
      Parameters:
      t - Tamable to use
      speedMod - Speed Modifier while following
      startDistance - How far away from owner to start walking towards
      stopDistance - How far away from owner to stop walking towards
      fly - Whether this Tamable can fly to its owner, if able at all
  • Method Details

    • getStartDistance

      public float getStartDistance()
      Gets the distance from the owner to start moving towards the owner
      Returns:
      distance needed to start moving
    • getStopDistance

      public float getStopDistance()
      Gets the distance from the owner to stop moving towards the owner
      Returns:
      distance needed to stop moving
    • setStartDistance

      public void setStartDistance(float start)
      Sets the distance from the owner to start moving towards the owner
      Parameters:
      start - distance from owner to start moving
    • setStopDistance

      public void setStopDistance(float stop)
      Sets the distance from the owner to stop moving to the owner
      Parameters:
      stop - distance from owner to stop moving
    • canFly

      public boolean canFly()
      Whether this Tame bale can fly to their owner.
      Returns:
      true if tamable can fly, else false
    • setCanFly

      public void setCanFly(boolean fly)
      Set whether this Tamable should fly to their owner.
      Parameters:
      fly - true if tamable can fly, else false
    • getSpeedModifier

      public double getSpeedModifier()
      Description copied from interface: SpeedModifier
      Get the Speed Modifier of this Pathfinder.
      Specified by:
      getSpeedModifier in interface SpeedModifier
      Returns:
      Speed Modifier
    • setSpeedModifier

      public void setSpeedModifier(double mod)
      Description copied from interface: SpeedModifier
      Sets the Speed Modifier of this Pathfinder.
      Specified by:
      setSpeedModifier in interface SpeedModifier
      Parameters:
      mod - Modifier to set
    • getFlags

      Description copied from class: Pathfinder

      Fetches an Array of Flags that this Pathfinder has.

      Specified by:
      getFlags in class Pathfinder
      Returns:
      Array of Pathfinder Flags
    • getInternalName

      public String getInternalName()
      Description copied from interface: PathfinderInfo
      Returns the NMS Internal Name.
      Specified by:
      getInternalName in interface PathfinderInfo
      Returns:
      Internal Name