From c7de89bebef42564771f3d1df08e11701035dec9 Mon Sep 17 00:00:00 2001 From: extendedclip Date: Fri, 31 Jul 2020 19:21:11 -0400 Subject: [PATCH] Add back deprecated getPlaceholders method --- .../clip/placeholderapi/PlaceholderAPI.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java b/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java index 1d57c37..c81d407 100644 --- a/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java +++ b/src/main/java/me/clip/placeholderapi/PlaceholderAPI.java @@ -22,6 +22,7 @@ package me.clip.placeholderapi; import com.google.common.collect.ImmutableSet; import java.util.List; +import java.util.Map; import java.util.Set; import java.util.regex.Matcher; import java.util.regex.Pattern; @@ -213,6 +214,24 @@ public final class PlaceholderAPI { return setRelationalPlaceholders(one, two, text, true); } + + /** + * Get map of registered placeholders + * + * @return Map of registered placeholders + * @deprecated Use {@link me.clip.placeholderapi.PlaceholderAPIPlugin().getLocalExpansionManager() + * .getExpansions()} instead. + */ + @NotNull + @Deprecated + @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") + public static Map getPlaceholders() + { + return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager() + .getExpansions().stream() + .collect(Collectors.toMap(PlaceholderExpansion::getIdentifier, ex -> ex)); + } + /** * Translate placeholders in the provided list based on the relation of the two provided players. *
The pattern of a valid placeholder is {@literal %rel__%}.