aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/com
diff options
context:
space:
mode:
authorKrakenied <krakenied1@gmail.com>2024-11-16 01:24:06 +0100
committerKrakenied <46192742+Krakenied@users.noreply.github.com>2025-05-13 20:34:15 +0200
commitd4b394bc06905510f4557178a148df71524bedc4 (patch)
treea35512a35d6040c1727f1fd83436b3d92698e786 /common/src/main/java/com
parentde11df0a59f0dea1a7a23936ec87a4a053414d65 (diff)
Counts towards completed option
Diffstat (limited to 'common/src/main/java/com')
-rw-r--r--common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java19
1 files changed, 18 insertions, 1 deletions
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<Quest> {
private boolean autoStartEnabled;
private boolean cancellable;
private boolean countsTowardsLimit;
+ private boolean countsTowardsCompleted;
private Map<String, String> placeholders;
private Map<String, String> progressPlaceholders;
private String categoryid;
@@ -330,6 +331,15 @@ public class Quest implements Comparable<Quest> {
}
/**
+ * 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.
*
* @see Comparable#compareTo(Object)
@@ -364,6 +374,7 @@ public class Quest implements Comparable<Quest> {
private boolean autoStartEnabled = false;
private boolean cancellable = true;
private boolean countsTowardsLimit = true;
+ private boolean countsTowardsCompleted = true;
private Map<String, String> placeholders = Collections.emptyMap();
private Map<String, String> progressPlaceholders = Collections.emptyMap();
private String categoryid = null;
@@ -482,6 +493,11 @@ public class Quest implements Comparable<Quest> {
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> {
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;