Interface EntityScheduleManager


public interface EntityScheduleManager
Represents the Schedule Manager for this Entity.

A Schedule is a routine that the Mob performs between every MC Day and Night, starting at 0 ticks and ending at 24,000 ticks.

Activities can switch automatically depending on the current action (e.g. during a raid Activity.RAID will be used). Setting active activities that do not apply to the Mob or are set at a poor time will be ignored.
  • Method Details

    • getCurrentSchedule

      @Nullable @Nullable Schedule getCurrentSchedule()
      Fetches the current schedule that this Mob has.
      Returns:
      Current Schedule, or null if none
    • setSchedule

      void setSchedule(@NotNull @NotNull Schedule schedule)
      Sets the current schedule.
      Parameters:
      schedule - Schedule to set
    • getActiveActivities

      @NotNull @NotNull Set<Activity> getActiveActivities()
      Fetches a set of all active activities.
      Returns:
      Set of active activities
    • setDefaultActivity

      void setDefaultActivity(@NotNull @NotNull Activity activity)
      Sets the current default Activity when no schedule is present.
      Parameters:
      activity - Activity to set
    • useDefaultActivity

      void useDefaultActivity()
      Uses the current default activity, overriding the current schedule.
    • setRunningActivity

      void setRunningActivity(@NotNull @NotNull Activity activity)
      Sets the Secondary Activity that is currently running.

      This activity wil not override the Activities in the current schedule, but is useful when running two activities at once.
      Parameters:
      activity - Activity Running
    • getRunningActivity

      @Nullable @Nullable Activity getRunningActivity()
      Fetches the Secondary Activity that is currently running.
      Returns:
      Secondary Activity Running, or null if none
    • isRunning

      boolean isRunning(@NotNull @NotNull Activity activity)
      Whether this Activity is currently active and running.
      Parameters:
      activity - Activity to check
      Returns:
      true if active, else false
    • put

      Associates an Activity with a function.
      Parameters:
      a - Activity to add
      func - Function associated with this Activity
      Returns:
      Function added
    • isEmpty

      boolean isEmpty()
      Whether the current running Activity Map is empty.
      Returns:
      true if no activities are associated, else false
    • size

      int size()
      Fetches the current Activity Map size.
      Returns:
      Activity Map Size
    • putAll

      default void putAll(Map<Activity,Consumer<Mob>> map)
      Associates all the activities with their respective functions.
      Parameters:
      map - Activity Map to put
    • clear

      void clear()
      Removes all activities from the current Activity Map.