Class QuestLoaderUtils
java.lang.Object
com.ordwen.odailyquests.quests.player.progression.QuestLoaderUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
checkTimestamp
(long timestamp) Check if it is time to redraw quests for a player.static AbstractQuest
Find quest with index in arrays.static AbstractQuest
getQuestAtIndex
(Category category, int index, String playerName) Try to get quest from index.static boolean
isTimeToRenew
(org.bukkit.entity.Player player, Map<String, PlayerQuests> activeQuests) Check if it's time to renew quests.static void
loadNewPlayerQuests
(String playerName, Map<String, PlayerQuests> activeQuests, Map<String, Integer> totalAchievedQuestsByCategory, int totalAchievedQuests) Load quests for a player with no data.
-
Method Details
-
checkTimestamp
public static boolean checkTimestamp(long timestamp) Check if it is time to redraw quests for a player.- Parameters:
timestamp
- player timestamp.- Returns:
- true if it's time to redraw quests.
-
loadNewPlayerQuests
public static void loadNewPlayerQuests(String playerName, Map<String, PlayerQuests> activeQuests, Map<String, Integer> totalAchievedQuestsByCategory, int totalAchievedQuests) Load quests for a player with no data.- Parameters:
playerName
- player name.activeQuests
- all active quests.
-
isTimeToRenew
public static boolean isTimeToRenew(org.bukkit.entity.Player player, Map<String, PlayerQuests> activeQuests) Check if it's time to renew quests. If so, renew them.- Parameters:
player
- player.activeQuests
- all active quests.- Returns:
- true if it's time to renew quests.
-
findQuest
Find quest with index in arrays.- Parameters:
playerName
- player name.questIndex
- index of quest in array.id
- number of player quest.- Returns:
- quest of index.
-
getQuestAtIndex
Try to get quest from index.- Parameters:
category
- the array where find the quest.index
- the supposed index of the quest in the array.playerName
- the name of the player for whom the quest is intended.- Returns:
- the quest.
-