The MissionsManager handles all mission-related operations including retrieving missions, checking completion status, and rewarding players.
Methods
getMission
Mission<?> getMission(String name)
Get a mission by its name.
The mission instance or null if not found
getAllMissions
List<Mission<?>> getAllMissions()
Get a list of all the missions.
getPlayerMissions
List<Mission<?>> getPlayerMissions()
Get a list of all missions that are player missions.
List of all player missions
getIslandMissions
List<Mission<?>> getIslandMissions()
Get a list of all missions that are island missions.
List of all island missions
Mission Categories
getMissionCategory
MissionCategory getMissionCategory(String name)
Get a mission category by its name.
The mission category or null if not found
getMissionCategories
List<MissionCategory> getMissionCategories()
Get all the mission categories.
List of all mission categories
Mission Completion Checks
hasCompleted
boolean hasCompleted(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not the player has already completed the mission.
True if player has completed, otherwise false
canComplete
boolean canComplete(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player can complete a mission.
True if player can complete, otherwise false
canCompleteNoProgress
boolean canCompleteNoProgress(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player can complete a mission, without considering progress.
True if player can complete, otherwise false
canCompleteAgain
boolean canCompleteAgain(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not the player can complete the mission again.
True if player can complete again, otherwise false
hasAllRequiredMissions
boolean hasAllRequiredMissions(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player has all the required missions to complete a mission.
True if player has all required missions, otherwise false
canPassAllChecks
boolean canPassAllChecks(SuperiorPlayer superiorPlayer, Mission<?> mission)
Check whether or not a player can pass all the checks to complete a mission.
True if player can pass all checks, otherwise false
Mission Rewards
rewardMission
void rewardMission(Mission<?> mission, SuperiorPlayer superiorPlayer, boolean checkAutoReward)
void rewardMission(Mission<?> mission, SuperiorPlayer superiorPlayer, boolean checkAutoReward, boolean forceReward)
void rewardMission(Mission<?> mission, SuperiorPlayer superiorPlayer, boolean checkAutoReward, boolean forceReward, @Nullable Consumer<Boolean> result)
Reward a player for completing a specific mission.
The mission that was completed
Whether or not the auto reward flag should be checked
Should the plugin force the reward to the player (no checks will be ran)
The result of the reward (nullable)
Data Management
saveMissionsData
Save all data related to missions. All the data is saved into a yaml file.
loadMissionsData
void loadMissionsData()
void loadMissionsData(List<Mission<?>> missionsList)
Load all data related to missions. All the data is loaded from a yaml file.
Load data for specific missions only (optional)