aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/com
diff options
context:
space:
mode:
authorLMBishop <13875753+LMBishop@users.noreply.github.com>2022-04-29 18:10:50 +0100
committerLMBishop <13875753+LMBishop@users.noreply.github.com>2022-04-29 18:10:50 +0100
commitd89f8086a496ed0923e41e86f11ab60b51e7f787 (patch)
treeab2084c5197726c3cc3230e8d6f5c92113b83674 /common/src/main/java/com
parent70bac90ae8c547e7e1fd4331f7079d458de08d34 (diff)
Add cancellable and counts towards limit options (closes #383)
Diffstat (limited to 'common/src/main/java/com')
-rw-r--r--common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java34
1 files changed, 34 insertions, 0 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 085ac0e9..999507b2 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
@@ -21,6 +21,8 @@ public class Quest implements Comparable<Quest> {
private int sortOrder;
private boolean permissionRequired;
private boolean autoStartEnabled;
+ private boolean cancellable;
+ private boolean countsTowardsLimit;
private Map<String, String> placeholders;
private String categoryid;
@@ -218,6 +220,24 @@ public class Quest implements Comparable<Quest> {
}
/**
+ * Get if this quest should be cancellable.
+ *
+ * @return boolean
+ */
+ public boolean isCancellable() {
+ return cancellable;
+ }
+
+ /**
+ * Get whether this quest should count towards the player's total quest limit.
+ *
+ * @return boolean
+ */
+ public boolean doesCountTowardsLimit() {
+ return countsTowardsLimit;
+ }
+
+ /**
* Compare the sort orders for this quest with another quest.
*
* @see Comparable#compareTo(Object)
@@ -243,6 +263,8 @@ public class Quest implements Comparable<Quest> {
private int sortOrder = 1;
private boolean permissionRequired = false;
private boolean autoStartEnabled = false;
+ private boolean cancellable = true;
+ private boolean countsTowardsLimit = true;
private Map<String, String> placeholders = Collections.emptyMap();
private String categoryid = null;
@@ -310,6 +332,16 @@ public class Quest implements Comparable<Quest> {
return this;
}
+ public Builder withCancellable(boolean cancellable) {
+ this.cancellable = cancellable;
+ return this;
+ }
+
+ public Builder withCountsTowardsLimit(boolean countsTowardsLimit) {
+ this.countsTowardsLimit = countsTowardsLimit;
+ return this;
+ }
+
public Builder inCategory(String categoryid) {
this.categoryid = categoryid;
return this;
@@ -329,6 +361,8 @@ public class Quest implements Comparable<Quest> {
quest.sortOrder = this.sortOrder;
quest.permissionRequired = this.permissionRequired;
quest.autoStartEnabled = this.autoStartEnabled;
+ quest.countsTowardsLimit = countsTowardsLimit;
+ quest.cancellable = this.cancellable;
quest.placeholders = this.placeholders;
quest.categoryid = this.categoryid;