From 7dd39455d92a5118ebc5aedde68f4eba5c138c83 Mon Sep 17 00:00:00 2001 From: LMBishop <13875753+LMBishop@users.noreply.github.com> Date: Mon, 26 Jul 2021 15:57:29 +0100 Subject: Add start commands --- .../com/leonardobishop/quests/common/quest/Quest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'common/src/main/java/com') 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 { private List requirements; private List rewardString; private List startString; + private List startCommands; private boolean repeatEnabled; private boolean cooldownEnabled; private int cooldown; @@ -145,6 +146,16 @@ public class Quest implements Comparable { return Collections.unmodifiableList(requirements); } + /** + * 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 getStartCommands() { + return Collections.unmodifiableList(startCommands); + } + /** * Get if this quest can be repeated after completion. * @@ -231,6 +242,7 @@ public class Quest implements Comparable { private List requirements = Collections.emptyList(); private List rewardString = Collections.emptyList(); private List startString = Collections.emptyList(); + private List startCommands = Collections.emptyList(); private boolean repeatEnabled = false; private boolean cooldownEnabled = false; private int cooldown = 0; @@ -264,6 +276,11 @@ public class Quest implements Comparable { return this; } + public Builder withStartCommands(List 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.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; -- cgit v1.2.3-70-g09d2