From 59699b92973a6991a4c7dbdaf76864569b5868f0 Mon Sep 17 00:00:00 2001 From: Rubenicos <44579213+Rubenicos@users.noreply.github.com> Date: Tue, 9 Jun 2020 16:26:35 -0600 Subject: Added getQuestsProgress --- .../questprogressfile/QuestProgressFile.java | 27 +++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'src/main/java') diff --git a/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java b/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java index 1697401d..2e751cd1 100644 --- a/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java +++ b/src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java @@ -237,6 +237,32 @@ public class QuestProgressFile { } return startedQuests; } + + public List getQuestsProgress(String type) { + List QuestsProgress = new ArrayList<>(); + if (type.equals("completed")) { + for (QuestProgress qProgress : questProgress.values()) { + if (qProgress.isCompleted()) { + QuestsProgress.add(plugin.getQuestManager().getQuestById(qProgress.getQuestId())); + } + } + } + if (type.equals("completedBefore")) { + for (QuestProgress qProgress : questProgress.values()) { + if (qProgress.isCompletedBefore()) { + QuestsProgress.add(plugin.getQuestManager().getQuestById(qProgress.getQuestId())); + } + } + } + if (type.equals("started")) { + for (QuestProgress qProgress : questProgress.values()) { + if (qProgress.isStarted()) { + QuestsProgress.add(plugin.getQuestManager().getQuestById(qProgress.getQuestId())); + } + } + } + return QuestsProgress; + } /** * Gets all the quest progress that it has ever encountered. @@ -368,4 +394,3 @@ public class QuestProgressFile { } } - -- cgit v1.2.3-70-g09d2