diff options
| author | Krakenied <Krakenied1@gmail.com> | 2024-02-20 11:39:40 +0100 |
|---|---|---|
| committer | Leonardo Bishop <13875753+LMBishop@users.noreply.github.com> | 2024-02-22 16:32:19 +0000 |
| commit | 52ded1a703d94a0354bb6b28ba6b4946e51dbf97 (patch) | |
| tree | 735e0ad3e99c9a4b3ab0e8d7ad3173d790ad59af /common/src/main/java/com/leonardobishop | |
| parent | 16794d9398de66a7625d5bb52b85b04271237abe (diff) | |
Add expiry commands option
Diffstat (limited to 'common/src/main/java/com/leonardobishop')
| -rw-r--r-- | common/src/main/java/com/leonardobishop/quests/common/quest/Quest.java | 18 |
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; |
