Package me.gamercoder215.mobchip.ai.goal
Class PathfinderFollowOwner
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderFollowOwner
- All Implemented Interfaces:
PathfinderInfo
,SpeedModifier
Represents a Pathfinder for a Tamable Animal to follow its owner
-
Nested Class Summary
Nested classes/interfaces inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
Pathfinder.PathfinderFlag
-
Field Summary
Fields inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
entity
Fields inherited from interface me.gamercoder215.mobchip.ai.SpeedModifier
DEFAULT_SPEED_MODIFIER
-
Constructor Summary
ConstructorsConstructorDescriptionPathfinderFollowOwner
(@NotNull Tameable t, double speedMod, float startDistance, float stopDistance) Creates a PathfinderFollowOwner with flying set to true.PathfinderFollowOwner
(@NotNull Tameable t, double speedMod, float startDistance, float stopDistance, boolean fly) Creates a PathfinderFollowOwner.PathfinderFollowOwner
(@NotNull Tameable t, float startDistance, float stopDistance) Creates a PathfinderFollowOwner with no speed modifier. -
Method Summary
Modifier and TypeMethodDescriptionboolean
canFly()
Whether this Tame bale can fly to their owner.getFlags()
Fetches an Array of Flags that this Pathfinder has.Returns the NMS Internal Name.double
Get the Speed Modifier of this Pathfinder.float
Gets the distance from the owner to start moving towards the ownerfloat
Gets the distance from the owner to stop moving towards the ownervoid
setCanFly
(boolean fly) Set whether this Tamable should fly to their owner.void
setSpeedModifier
(double mod) Sets the Speed Modifier of this Pathfinder.void
setStartDistance
(float start) Sets the distance from the owner to start moving towards the ownervoid
setStopDistance
(float stop) Sets the distance from the owner to stop moving to the ownerMethods inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
getEntity
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface me.gamercoder215.mobchip.ai.goal.PathfinderInfo
getName
-
Constructor Details
-
PathfinderFollowOwner
Creates a PathfinderFollowOwner with no speed modifier.- Parameters:
t
- Tamable EntitystartDistance
- How far away from owner to start walking towardsstopDistance
- 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 usespeedMod
- Speed Modifier while followingstartDistance
- How far away from owner to start walking towardsstopDistance
- 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 usespeedMod
- Speed Modifier while followingstartDistance
- How far away from owner to start walking towardsstopDistance
- How far away from owner to stop walking towardsfly
- 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 interfaceSpeedModifier
- 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 interfaceSpeedModifier
- Parameters:
mod
- Modifier to set
-
getFlags
Description copied from class:Pathfinder
Fetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlags
in classPathfinder
- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfo
Returns the NMS Internal Name.- Specified by:
getInternalName
in interfacePathfinderInfo
- Returns:
- Internal Name
-