aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
Diffstat (limited to 'common')
-rw-r--r--common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java38
1 files changed, 36 insertions, 2 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 3e7fc193..a3cc26f9 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
@@ -20,6 +20,8 @@ public class Quest implements Comparable<Quest> {
private List<String> requirements;
private List<String> rewardString;
private List<String> startString;
+ private List<String> cancelString;
+ private List<String> expiryString;
private List<String> startCommands;
private List<String> cancelCommands;
private List<String> expiryCommands;
@@ -124,6 +126,26 @@ public class Quest implements Comparable<Quest> {
}
/**
+ * Get the cancel string of the quest.
+ * The cancel string is a series of messages sent to the player upon cancelling the quest.
+ *
+ * @return immutable list of messages to send
+ */
+ public @NotNull List<String> getCancelString() {
+ return Collections.unmodifiableList(cancelString);
+ }
+
+ /**
+ * Get the expiry string of the quest.
+ * The expiry string is a series of messages sent to the player upon expiring the quest.
+ *
+ * @return immutable list of messages to send
+ */
+ public @NotNull List<String> getExpiryString() {
+ return Collections.unmodifiableList(expiryString);
+ }
+
+ /**
* Get the id of this quest.
*
* @return id
@@ -315,6 +337,8 @@ public class Quest implements Comparable<Quest> {
private List<String> requirements = Collections.emptyList();
private List<String> rewardString = Collections.emptyList();
private List<String> startString = Collections.emptyList();
+ private List<String> cancelString = Collections.emptyList();
+ private List<String> expiryString = Collections.emptyList();
private List<String> startCommands = Collections.emptyList();
private List<String> cancelCommands = Collections.emptyList();
private List<String> expiryCommands = Collections.emptyList();
@@ -356,6 +380,16 @@ public class Quest implements Comparable<Quest> {
return this;
}
+ public Builder withCancelString(List<String> cancelString) {
+ this.cancelString = cancelString;
+ return this;
+ }
+
+ public Builder withExpiryString(List<String> expiryString) {
+ this.expiryString = expiryString;
+ return this;
+ }
+
public Builder withStartCommands(List<String> startCommands) {
this.startCommands = startCommands;
return this;
@@ -443,6 +477,8 @@ public class Quest implements Comparable<Quest> {
quest.requirements = this.requirements;
quest.rewardString = this.rewardString;
quest.startString = this.startString;
+ quest.cancelString = this.cancelString;
+ quest.expiryString = this.expiryString;
quest.startCommands = this.startCommands;
quest.cancelCommands = this.cancelCommands;
quest.expiryCommands = this.expiryCommands;
@@ -459,9 +495,7 @@ public class Quest implements Comparable<Quest> {
quest.placeholders = this.placeholders;
quest.progressPlaceholders = this.progressPlaceholders;
quest.categoryid = this.categoryid;
-
return quest;
}
-
}
}