aboutsummaryrefslogtreecommitdiffstats
path: root/common/src/main/java/com
diff options
context:
space:
mode:
Diffstat (limited to 'common/src/main/java/com')
-rw-r--r--common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java18
1 files changed, 18 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 6af3fcf3..3e7fc193 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
@@ -22,6 +22,7 @@ public class Quest implements Comparable<Quest> {
private List<String> startString;
private List<String> startCommands;
private List<String> cancelCommands;
+ private List<String> expiryCommands;
private boolean repeatEnabled;
private boolean cooldownEnabled;
private int cooldown;
@@ -173,6 +174,16 @@ public class Quest implements Comparable<Quest> {
}
/**
+ * Get the expiry commands for this quest.
+ * The expiry commands is a list of commands to be executed upon expiring the quest.
+ *
+ * @return immutable list of commands
+ */
+ public List<String> getExpiryCommands() {
+ return Collections.unmodifiableList(expiryCommands);
+ }
+
+ /**
* Get if this quest can be repeated after completion.
*
* @return boolean
@@ -306,6 +317,7 @@ public class Quest implements Comparable<Quest> {
private List<String> startString = Collections.emptyList();
private List<String> startCommands = Collections.emptyList();
private List<String> cancelCommands = Collections.emptyList();
+ private List<String> expiryCommands = Collections.emptyList();
private boolean repeatEnabled = false;
private boolean cooldownEnabled = false;
private int cooldown = 0;
@@ -354,6 +366,11 @@ public class Quest implements Comparable<Quest> {
return this;
}
+ public Builder withExpiryCommands(List<String> expiryCommands) {
+ this.expiryCommands = expiryCommands;
+ return this;
+ }
+
public Builder withSortOrder(int sortOrder) {
this.sortOrder = sortOrder;
return this;
@@ -428,6 +445,7 @@ public class Quest implements Comparable<Quest> {
quest.startString = this.startString;
quest.startCommands = this.startCommands;
quest.cancelCommands = this.cancelCommands;
+ quest.expiryCommands = this.expiryCommands;
quest.repeatEnabled = this.repeatEnabled;
quest.cooldownEnabled = this.cooldownEnabled;
quest.cooldown = this.cooldown;