From 1cbede7b46bf36695b581031be49bd827601b2aa Mon Sep 17 00:00:00 2001 From: Krakenied Date: Fri, 15 Sep 2023 16:44:59 +0200 Subject: Add dedicated progress placeholders section --- .../com/leonardobishop/quests/common/quest/Quest.java | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'common/src/main') 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 f12c9a5f..22ba889d 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 @@ -26,6 +26,7 @@ public class Quest implements Comparable { private boolean cancellable; private boolean countsTowardsLimit; private Map placeholders; + private Map progressPlaceholders; private String categoryid; private Quest() { } @@ -221,6 +222,15 @@ public class Quest implements Comparable { return Collections.unmodifiableMap(placeholders); } + /** + * Get the local progress placeholders for this quest, which is not exposed to PlaceholderAPI. + * + * @return immutable map of progress placeholders + */ + public @NotNull Map getProgressPlaceholders() { + return Collections.unmodifiableMap(progressPlaceholders); + } + /** * Get the sort order for this quest in the GUI. * Numbers closer to Integer.MIN_VALUE have greater priority. @@ -289,6 +299,7 @@ public class Quest implements Comparable { private boolean cancellable = true; private boolean countsTowardsLimit = true; private Map placeholders = Collections.emptyMap(); + private Map progressPlaceholders = Collections.emptyMap(); private String categoryid = null; public Builder(String id) { @@ -340,6 +351,11 @@ public class Quest implements Comparable { return this; } + public Builder withProgressPlaceholders(Map progressPlaceholders) { + this.progressPlaceholders = progressPlaceholders; + return this; + } + public Builder withRepeatEnabled(boolean repeatEnabled) { this.repeatEnabled = repeatEnabled; return this; @@ -399,6 +415,7 @@ public class Quest implements Comparable { quest.countsTowardsLimit = countsTowardsLimit; quest.cancellable = this.cancellable; quest.placeholders = this.placeholders; + quest.progressPlaceholders = this.progressPlaceholders; quest.categoryid = this.categoryid; return quest; -- cgit v1.2.3-70-g09d2