summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRubenicos <44579213+Rubenicos@users.noreply.github.com>2020-06-09 16:26:35 -0600
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2020-06-23 00:23:08 +0100
commit59699b92973a6991a4c7dbdaf76864569b5868f0 (patch)
tree2c3acc613a790c819a06f12cb0f83aad4ce2899e
parent1c9acf15e2c665498f44a39a818cabfd484077a9 (diff)
Added getQuestsProgress
-rw-r--r--src/main/java/com/leonardobishop/quests/player/questprogressfile/QuestProgressFile.java27
1 files changed, 26 insertions, 1 deletions
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<Quest> getQuestsProgress(String type) {
+ List<Quest> 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 {
}
}
-