Class PathfinderBreakDoor

java.lang.Object
me.gamercoder215.mobchip.ai.goal.Pathfinder
me.gamercoder215.mobchip.ai.goal.PathfinderBreakDoor
All Implemented Interfaces:
Conditional<Difficulty>, PathfinderInfo

public final class PathfinderBreakDoor extends Pathfinder implements Conditional<Difficulty>
Represents a Pathfinder that has a Mob break a door
  • Field Details

    • DEFAULT_DOOR_BREAK_TIME

      public static final int DEFAULT_DOOR_BREAK_TIME
      Default amount of ticks it takes to break a door
      See Also:
  • Constructor Details

    • PathfinderBreakDoor

      public PathfinderBreakDoor(@NotNull @NotNull Mob m, Difficulty... validDifficulties)
      Constructs a PathfinderBreakDoor with the default break time.
      Parameters:
      m - Mob to use
      validDifficulties - Difficulties that this Pathfinder will work on
    • PathfinderBreakDoor

      public PathfinderBreakDoor(@NotNull @NotNull Mob m, int breakTime, Difficulty... validDifficulties) throws IllegalArgumentException
      Constructs a PathfinderBreakDoor.
      Parameters:
      m - Mob to use
      breakTime - How many ticks it takes to break a door
      validDifficulties - Difficulties that this Pathfinder will work on
      Throws:
      IllegalArgumentException - if time is less than or equal to 0
    • PathfinderBreakDoor

      public PathfinderBreakDoor(@NotNull @NotNull Mob m, int breakTime, Predicate<Difficulty> validDiffs) throws IllegalArgumentException
      Constructs a PathfinderBreakDoor with a predicate.
      Parameters:
      m - Mob to use
      breakTime - How many ticks it takes to break a door
      validDiffs - Predicate that determines if the Pathfinder should work on a given difficulty
      Throws:
      IllegalArgumentException - if time is less than or equal to 0
  • Method Details

    • getBreakTime

      public int getBreakTime()
      Gets the amount of ticks it takes to break a door.
      Returns:
      Amount of ticks it takes
    • getCondition

      @NotNull public @NotNull Predicate<Difficulty> getCondition()
      Description copied from interface: Conditional
      Sets the Condition of this Conditional Pathfinder.
      Specified by:
      getCondition in interface Conditional<Difficulty>
      Returns:
      Predicate of Condition
    • setBreakTime

      public void setBreakTime(int time) throws IllegalArgumentException
      Sets the amount of ticks it takes to break a door.
      Parameters:
      time - Amount of ticks to set
      Throws:
      IllegalArgumentException - if time is less than or equal to 0
    • setCondition

      public void setCondition(@NotNull @NotNull Predicate<Difficulty> condition)
      Description copied from interface: Conditional
      Sets the Condition of this Conditional Pathfinder.
      Specified by:
      setCondition in interface Conditional<Difficulty>
      Parameters:
      condition - Condition to set
    • getFlags

      @NotNull public @NotNull Pathfinder.PathfinderFlag[] 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 pathfinder's internal name. This may match the actual NMS name of the pathfinder, but it may not.
      Specified by:
      getInternalName in interface PathfinderInfo
      Returns:
      Internal Name