Class PathfinderMoveThroughVillage

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

public final class PathfinderMoveThroughVillage extends Pathfinder implements SpeedModifier, Ranged
Represents a Pathfinder for a Creature to move throughout a Village
  • Field Details

    • DEFAULT_MIN_DISTANCE

      public static final int DEFAULT_MIN_DISTANCE
      Default Minimum Distance from a village to start moving through a village
      See Also:
    • DEFAULT_USE_DOORS

      public static final BooleanSupplier DEFAULT_USE_DOORS
      Default Supplier to Use Doors (true)
  • Constructor Details

    • PathfinderMoveThroughVillage

      public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c)
      Constructs a PathfinderMoveThroughVillage with the DEFAULT_USE_DOORS.
      Parameters:
      c - Creature to use
    • PathfinderMoveThroughVillage

      public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, boolean useDoors)
      Constructs a PathfinderMoveThroughVillage with a boolean.
      Parameters:
      c - Creature to use
      useDoors - 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 use
      useDoors - Supplier called if the entity can use doors
    • PathfinderMoveThroughVillage

      public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, @NotNull @NotNull BooleanSupplier useDoors, double speedMod)
      Constructs a PathfinderMoveThroughVillage with DEFAULT_MIN_DISTANCE.
      Parameters:
      c - Creature to use
      useDoors - Supplier called if the entity can use doors
      speedMod - Speed Modifier while moving
    • PathfinderMoveThroughVillage

      public PathfinderMoveThroughVillage(@NotNull @NotNull Creature c, boolean useDoors, double speedMod)
      Constructs a PathfinderMoveThroughVillage with DEFAULT_MIN_DISTANCE.
      Parameters:
      c - Creature to use
      useDoors - true if mob can use doors, else false
      speedMod - 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 use
      useDoors - Supplier called if the entity can use doors
      speedMod - Speed Modifier while moving
      minDistance - 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 use
      useDoors - true if mob can use doors, else false
      speedMod - Speed Modifier while moving
      minDistance - 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 use
      useDoors - True if mob can use doors, else false
      speedMod - Speed Modifier while moving
      minDistance - Minimum distance from a village
      onlyAtNight - 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 use
      useDoors - Supplier called if the entity can use doors
      speedMod - Speed Modifier while moving
      minDistance - Minimum distance from a village
      onlyAtNight - Whether Creature can only move through village at night
  • Method Details

    • canUseDoors

      public BooleanSupplier canUseDoors()
      Fetches the Function used in whether this entity can use doors throughout the Village.
      Returns:
      Function of using doors
    • setCanUseDoors

      public void setCanUseDoors(@NotNull @NotNull BooleanSupplier b)
      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 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
    • getRange

      public float getRange()
      Gets this Range as a Float.
      Specified by:
      getRange in interface Ranged
      Returns:
      Range as float
    • setRange

      public void setRange(float range) throws IllegalArgumentException
      Sets the range needed from a village to start walking to a village.
      Specified by:
      setRange in interface Ranged
      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 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