Interface EntityScheduleManager
public interface EntityScheduleManager
Represents the Schedule Manager for this Entity.
A
Activities can switch automatically depending on the current action (e.g. during a raid
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 Summary
Modifier and TypeMethodDescriptionvoid
clear()
Removes all activities from the current Activity Map.Fetches a set of all active activities.Fetches the current schedule that this Mob has.Fetches the Secondary Activity that is currently running.boolean
isEmpty()
Whether the current running Activity Map is empty.boolean
Whether this Activity is currently active and running.Associates an Activity with a function.default void
Associates all the activities with their respective functions.void
setDefaultActivity
(@NotNull Activity activity) Sets the current default Activity when no schedule is present.void
setRunningActivity
(@NotNull Activity activity) Sets the Secondary Activity that is currently running.void
setSchedule
(@NotNull Schedule schedule) Sets the current schedule.int
size()
Fetches the current Activity Map size.void
Uses the current default activity, overriding the current schedule.
-
Method Details
-
getCurrentSchedule
Fetches the current schedule that this Mob has.- Returns:
- Current Schedule, or null if none
-
setSchedule
Sets the current schedule.- Parameters:
schedule
- Schedule to set
-
getActiveActivities
Fetches a set of all active activities.- Returns:
- Set of active activities
-
setDefaultActivity
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
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
Fetches the Secondary Activity that is currently running.- Returns:
- Secondary Activity Running, or null if none
-
isRunning
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 addfunc
- 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
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.
-