diff options
Diffstat (limited to 'common/src/main/java')
| -rw-r--r-- | common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java | 34 |
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; |
