aboutsummaryrefslogtreecommitdiffstats
path: root/common/src
diff options
context:
space:
mode:
Diffstat (limited to 'common/src')
-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 45dfde96..6af3fcf3 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,7 @@ public class Quest implements Comparable<Quest> {
private List<String> rewardString;
private List<String> startString;
private List<String> startCommands;
+ private List<String> cancelCommands;
private boolean repeatEnabled;
private boolean cooldownEnabled;
private int cooldown;
@@ -162,6 +163,16 @@ public class Quest implements Comparable<Quest> {
}
/**
+ * Get the cancel commands for this quest.
+ * The cancel commands is a list of commands to be executed upon cancelling the quest.
+ *
+ * @return immutable list of commands
+ */
+ public List<String> getCancelCommands() {
+ return Collections.unmodifiableList(cancelCommands);
+ }
+
+ /**
* Get if this quest can be repeated after completion.
*
* @return boolean
@@ -294,6 +305,7 @@ public class Quest implements Comparable<Quest> {
private List<String> rewardString = Collections.emptyList();
private List<String> startString = Collections.emptyList();
private List<String> startCommands = Collections.emptyList();
+ private List<String> cancelCommands = Collections.emptyList();
private boolean repeatEnabled = false;
private boolean cooldownEnabled = false;
private int cooldown = 0;
@@ -337,6 +349,11 @@ public class Quest implements Comparable<Quest> {
return this;
}
+ public Builder withCancelCommands(List<String> cancelCommands) {
+ this.cancelCommands = cancelCommands;
+ return this;
+ }
+
public Builder withSortOrder(int sortOrder) {
this.sortOrder = sortOrder;
return this;
@@ -410,6 +427,7 @@ public class Quest implements Comparable<Quest> {
quest.rewardString = this.rewardString;
quest.startString = this.startString;
quest.startCommands = this.startCommands;
+ quest.cancelCommands = this.cancelCommands;
quest.repeatEnabled = this.repeatEnabled;
quest.cooldownEnabled = this.cooldownEnabled;
quest.cooldown = this.cooldown;