Package me.gamercoder215.mobchip.ai.goal
Class PathfinderMoveThroughVillage
java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderMoveThroughVillage
- All Implemented Interfaces:
PathfinderInfo
,Ranged
,SpeedModifier
Represents a Pathfinder for a Creature to move throughout a Village
-
Nested Class Summary
Nested classes/interfaces inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
Pathfinder.PathfinderFlag
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Default Minimum Distance from a village to start moving through a villagestatic final BooleanSupplier
Default Supplier to Use Doors (true)Fields inherited from class me.gamercoder215.mobchip.ai.goal.Pathfinder
entity
Fields inherited from interface me.gamercoder215.mobchip.ai.goal.Ranged
DEFAULT_ATTACK_INTERVAL, DEFAULT_ATTACK_RANGE, DEFAULT_LOOK_RANGE
Fields inherited from interface me.gamercoder215.mobchip.ai.SpeedModifier
DEFAULT_SPEED_MODIFIER
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs a PathfinderMoveThroughVillage with theDEFAULT_USE_DOORS
.PathfinderMoveThroughVillage
(@NotNull Creature c, boolean useDoors) Constructs a PathfinderMoveThroughVillage with a boolean.PathfinderMoveThroughVillage
(@NotNull Creature c, boolean useDoors, double speedMod) Constructs a PathfinderMoveThroughVillage withDEFAULT_MIN_DISTANCE
.PathfinderMoveThroughVillage
(@NotNull Creature c, boolean useDoors, double speedMod, int minDistance) Constructs a PathfinderMoveThroughVillage with onlyAtNight set to falsePathfinderMoveThroughVillage
(@NotNull Creature c, boolean useDoors, double speedMod, int minDistance, boolean onlyAtNight) Constructs a PathfinderMoveThroughVillage.PathfinderMoveThroughVillage
(@NotNull Creature c, @NotNull BooleanSupplier useDoors) Constructs a PathfinderMoveThroughVillage with no speed modifier.PathfinderMoveThroughVillage
(@NotNull Creature c, @NotNull BooleanSupplier useDoors, double speedMod) Constructs a PathfinderMoveThroughVillage withDEFAULT_MIN_DISTANCE
.PathfinderMoveThroughVillage
(@NotNull Creature c, @NotNull BooleanSupplier useDoors, double speedMod, int minDistance) Constructs a PathfinderMoveThroughVillage with onlyAtNight set to falsePathfinderMoveThroughVillage
(@NotNull Creature c, @NotNull BooleanSupplier useDoors, double speedMod, int minDistance, boolean onlyAtNight) Constructs a PathfinderMoveThroughVillage. -
Method Summary
Modifier and TypeMethodDescriptionFetches the Function used in whether this entity can use doors throughout the Village.getFlags()
Fetches an Array of Flags that this Pathfinder has.Returns the NMS Internal Name.int
Gets the minimum distance from a village to move through it.float
getRange()
Gets this Range as a Float.double
Get the Speed Modifier of this Pathfinder.boolean
Whether it has to be nighttime to roam the Village.void
setCanUseDoors
(boolean use) Sets whether this entity can use doors throughout the Village.void
Sets the Function used in whether this entity can use doors throughout the Village.void
setMinDistance
(int min) Sets the minimum distance from a village to move through it.void
setMustBeNight
(boolean night) Sets whether it has to be nighttime to roam the Village.void
setRange
(float range) Sets the range needed from a village to start walking to a village.void
setSpeedModifier
(double mod) Sets the Speed Modifier of this Pathfinder.Methods 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
-
Field Details
-
DEFAULT_MIN_DISTANCE
public static final int DEFAULT_MIN_DISTANCEDefault Minimum Distance from a village to start moving through a village- See Also:
-
DEFAULT_USE_DOORS
Default Supplier to Use Doors (true)
-
-
Constructor Details
-
PathfinderMoveThroughVillage
Constructs a PathfinderMoveThroughVillage with theDEFAULT_USE_DOORS
.- Parameters:
c
- Creature to use
-
PathfinderMoveThroughVillage
Constructs a PathfinderMoveThroughVillage with a boolean.- Parameters:
c
- Creature to useuseDoors
- true if mob can use doors, else false
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, @NotNull @NotNull BooleanSupplier useDoors) Constructs a PathfinderMoveThroughVillage with no speed modifier.- Parameters:
c
- Creature to useuseDoors
- Supplier called if the entity can use doors
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, @NotNull @NotNull BooleanSupplier useDoors, double speedMod) Constructs a PathfinderMoveThroughVillage withDEFAULT_MIN_DISTANCE
.- Parameters:
c
- Creature to useuseDoors
- Supplier called if the entity can use doorsspeedMod
- Speed Modifier while moving
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, boolean useDoors, double speedMod) Constructs a PathfinderMoveThroughVillage withDEFAULT_MIN_DISTANCE
.- Parameters:
c
- Creature to useuseDoors
- true if mob can use doors, else falsespeedMod
- Speed Modifier while moving
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, @NotNull @NotNull BooleanSupplier useDoors, double speedMod, int minDistance) Constructs a PathfinderMoveThroughVillage with onlyAtNight set to false- Parameters:
c
- Creature to useuseDoors
- Supplier called if the entity can use doorsspeedMod
- Speed Modifier while movingminDistance
- Minimum distance from a village
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, boolean useDoors, double speedMod, int minDistance) Constructs a PathfinderMoveThroughVillage with onlyAtNight set to false- Parameters:
c
- Creature to useuseDoors
- true if mob can use doors, else falsespeedMod
- Speed Modifier while movingminDistance
- Minimum distance from a village
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, boolean useDoors, double speedMod, int minDistance, boolean onlyAtNight) Constructs a PathfinderMoveThroughVillage.- Parameters:
c
- Creature to useuseDoors
- True if mob can use doors, else falsespeedMod
- Speed Modifier while movingminDistance
- Minimum distance from a villageonlyAtNight
- Whether Creature can only move through village at night
-
PathfinderMoveThroughVillage
public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, @NotNull @NotNull BooleanSupplier useDoors, double speedMod, int minDistance, boolean onlyAtNight) Constructs a PathfinderMoveThroughVillage.- Parameters:
c
- Creature to useuseDoors
- Supplier called if the entity can use doorsspeedMod
- Speed Modifier while movingminDistance
- Minimum distance from a villageonlyAtNight
- Whether Creature can only move through village at night
-
-
Method Details
-
canUseDoors
Fetches the Function used in whether this entity can use doors throughout the Village.- Returns:
- Function of using doors
-
setCanUseDoors
Sets the Function used in whether this entity can use doors throughout the Village.- Parameters:
b
- Function to use
-
setCanUseDoors
public void setCanUseDoors(boolean use) Sets whether this entity can use doors throughout the Village.- Parameters:
use
- true if entity can use, else false
-
getMinDistance
public int getMinDistance()Gets the minimum distance from a village to move through it.- Returns:
- Minimum distance from a village
-
setMinDistance
public void setMinDistance(int min) Sets the minimum distance from a village to move through it.- Parameters:
min
- Minimum distance from a village
-
mustBeNight
public boolean mustBeNight()Whether it has to be nighttime to roam the Village.- Returns:
- true if time must be night, else false
-
setMustBeNight
public void setMustBeNight(boolean night) Sets whether it has to be nighttime to roam the Village.- Parameters:
night
- true if time must be night, 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
-
getRange
public float getRange()Gets this Range as a Float. -
setRange
Sets the range needed from a village to start walking to a village.- Specified by:
setRange
in interfaceRanged
- Parameters:
range
- Range, as an int- Throws:
IllegalArgumentException
- if not an integer
-
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
-