diff options
| author | Krakenied <Krakenied1@gmail.com> | 2024-06-01 10:52:50 +0200 |
|---|---|---|
| committer | Leonardo Bishop <13875753+LMBishop@users.noreply.github.com> | 2024-06-03 18:48:22 +0100 |
| commit | b67ffadcac3c5c2b019c4bee53f9441fb7913c22 (patch) | |
| tree | 2aab2b5a493889cf31a4725d8f901d52d2df5712 /common/src/main | |
| parent | 7f44beb0010e16f0f1b2463ee5392ab148f73cd2 (diff) | |
Add cancelstring and expirystring options
Closes https://github.com/LMBishop/Quests/issues/667
Diffstat (limited to 'common/src/main')
| -rw-r--r-- | common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java | 38 |
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; } - } } |
