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 Pathfinder
Pathfinder.PathfinderFlag -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intDefault Minimum Distance from a village to start moving through a villagestatic final BooleanSupplierDefault Supplier to Use Doors (true)Fields inherited from class Pathfinder
entityFields inherited from interface Ranged
DEFAULT_ATTACK_INTERVAL, DEFAULT_ATTACK_RANGE, DEFAULT_LOOK_RANGEFields inherited from interface SpeedModifier
DEFAULT_SPEED_MODIFIER -
Constructor Summary
ConstructorsConstructorDescriptionPathfinderMoveThroughVillage(@NotNull Creature c) Constructs 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.@NotNull Pathfinder.PathfinderFlag[]getFlags()Fetches an Array of Flags that this Pathfinder has.Returns the pathfinder's internal name.intGets the minimum distance from a village to move through it.floatgetRange()Gets this Range as a Float.doubleGet the Speed Modifier of this Pathfinder.booleanWhether it has to be nighttime to roam the Village.voidsetCanUseDoors(boolean use) Sets whether this entity can use doors throughout the Village.voidsetCanUseDoors(@NotNull BooleanSupplier b) Sets the Function used in whether this entity can use doors throughout the Village.voidsetMinDistance(int min) Sets the minimum distance from a village to move through it.voidsetMustBeNight(boolean night) Sets whether it has to be nighttime to roam the Village.voidsetRange(float range) Sets the range needed from a village to start walking to a village.voidsetSpeedModifier(double mod) Sets the Speed Modifier of this Pathfinder.Methods inherited from class Pathfinder
getEntityMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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:SpeedModifierGet the Speed Modifier of this Pathfinder.- Specified by:
getSpeedModifierin interfaceSpeedModifier- Returns:
- Speed Modifier
-
setSpeedModifier
public void setSpeedModifier(double mod) Description copied from interface:SpeedModifierSets the Speed Modifier of this Pathfinder.- Specified by:
setSpeedModifierin interfaceSpeedModifier- Parameters:
mod- Modifier to set
-
getRange
-
setRange
Sets the range needed from a village to start walking to a village.- Specified by:
setRangein interfaceRanged- Parameters:
range- Range, as an int- Throws:
IllegalArgumentException- if not an integer
-
getFlags
Description copied from class:PathfinderFetches an Array of Flags that this Pathfinder has.
- Specified by:
getFlagsin classPathfinder- Returns:
- Array of Pathfinder Flags
-
getInternalName
Description copied from interface:PathfinderInfoReturns the pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.- Specified by:
getInternalNamein interfacePathfinderInfo- Returns:
- Internal Name
-