diff options
| author | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2021-07-26 15:57:29 +0100 |
|---|---|---|
| committer | LMBishop <13875753+LMBishop@users.noreply.github.com> | 2021-07-26 15:57:29 +0100 |
| commit | 7dd39455d92a5118ebc5aedde68f4eba5c138c83 (patch) | |
| tree | 848b236cb2ad87ffba3e1863fb5a671001e2e60d /common | |
| parent | d8c60882d408875e702a3ca12461ee5220f3a30a (diff) | |
Add start commands
Diffstat (limited to 'common')
| -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 6a591e1d..7f2a583f 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,7 @@ public class Quest implements Comparable<Quest> { private List<String> requirements; private List<String> rewardString; private List<String> startString; + private List<String> startCommands; private boolean repeatEnabled; private boolean cooldownEnabled; private int cooldown; @@ -146,6 +147,16 @@ public class Quest implements Comparable<Quest> { } /** + * Get the start commands for this quest. + * The start commands is a list of commands to be executed upon starting the quest. + * + * @return immutable list of commands + */ + public List<String> getStartCommands() { + return Collections.unmodifiableList(startCommands); + } + + /** * Get if this quest can be repeated after completion. * * @return boolean @@ -231,6 +242,7 @@ 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> startCommands = Collections.emptyList(); private boolean repeatEnabled = false; private boolean cooldownEnabled = false; private int cooldown = 0; @@ -264,6 +276,11 @@ public class Quest implements Comparable<Quest> { return this; } + public Builder withStartCommands(List<String> startCommands) { + this.startCommands = startCommands; + return this; + } + public Builder withSortOrder(int sortOrder) { this.sortOrder = sortOrder; return this; @@ -311,6 +328,7 @@ public class Quest implements Comparable<Quest> { quest.requirements = this.requirements; quest.rewardString = this.rewardString; quest.startString = this.startString; + quest.startCommands = this.startCommands; quest.repeatEnabled = this.repeatEnabled; quest.cooldownEnabled = this.cooldownEnabled; quest.cooldown = this.cooldown; |
