From d4b394bc06905510f4557178a148df71524bedc4 Mon Sep 17 00:00:00 2001 From: Krakenied Date: Sat, 16 Nov 2024 01:24:06 +0100 Subject: Counts towards completed option --- .../com/leonardobishop/quests/common/quest/Quest.java | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'common/src/main/java') diff --git a/common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java b/common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java index df3a1aaf..2a0ed080 100644 --- a/common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java +++ b/common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java @@ -36,6 +36,7 @@ public class Quest implements Comparable { private boolean autoStartEnabled; private boolean cancellable; private boolean countsTowardsLimit; + private boolean countsTowardsCompleted; private Map placeholders; private Map progressPlaceholders; private String categoryid; @@ -329,6 +330,15 @@ public class Quest implements Comparable { return countsTowardsLimit; } + /** + * Get whether this quest should count towards the player's quests completed. + * + * @return boolean + */ + public boolean doesCountTowardsCompleted() { + return countsTowardsCompleted; + } + /** * Compare the sort orders for this quest with another quest. * @@ -364,6 +374,7 @@ public class Quest implements Comparable { private boolean autoStartEnabled = false; private boolean cancellable = true; private boolean countsTowardsLimit = true; + private boolean countsTowardsCompleted = true; private Map placeholders = Collections.emptyMap(); private Map progressPlaceholders = Collections.emptyMap(); private String categoryid = null; @@ -482,6 +493,11 @@ public class Quest implements Comparable { return this; } + public Builder withCountsTowardsCompleted(boolean countsTowardsCompleted) { + this.countsTowardsCompleted = countsTowardsCompleted; + return this; + } + public Builder inCategory(String categoryid) { this.categoryid = categoryid; return this; @@ -508,7 +524,8 @@ public class Quest implements Comparable { quest.sortOrder = this.sortOrder; quest.permissionRequired = this.permissionRequired; quest.autoStartEnabled = this.autoStartEnabled; - quest.countsTowardsLimit = countsTowardsLimit; + quest.countsTowardsLimit = this.countsTowardsLimit; + quest.countsTowardsCompleted = this.countsTowardsCompleted; quest.cancellable = this.cancellable; quest.placeholders = this.placeholders; quest.progressPlaceholders = this.progressPlaceholders; -- cgit v1.2.3-70-g09d2