From 52ded1a703d94a0354bb6b28ba6b4946e51dbf97 Mon Sep 17 00:00:00 2001 From: Krakenied Date: Tue, 20 Feb 2024 11:39:40 +0100 Subject: Add expiry commands option --- .../com/leonardobishop/quests/common/quest/Quest.java | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'common') 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 { private List startString; private List startCommands; private List cancelCommands; + private List expiryCommands; private boolean repeatEnabled; private boolean cooldownEnabled; private int cooldown; @@ -172,6 +173,16 @@ public class Quest implements Comparable { return Collections.unmodifiableList(cancelCommands); } + /** + * 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 getExpiryCommands() { + return Collections.unmodifiableList(expiryCommands); + } + /** * Get if this quest can be repeated after completion. * @@ -306,6 +317,7 @@ public class Quest implements Comparable { private List startString = Collections.emptyList(); private List startCommands = Collections.emptyList(); private List cancelCommands = Collections.emptyList(); + private List expiryCommands = Collections.emptyList(); private boolean repeatEnabled = false; private boolean cooldownEnabled = false; private int cooldown = 0; @@ -354,6 +366,11 @@ public class Quest implements Comparable { return this; } + public Builder withExpiryCommands(List 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.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; -- cgit v1.2.3-70-g09d2