Add back deprecated getPlaceholders method

This commit is contained in:
extendedclip 2020-07-31 19:21:11 -04:00
parent 0e733b6933
commit c7de89bebe

View File

@ -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<String, PlaceholderHook> 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.
* <br>The pattern of a valid placeholder is {@literal %rel_<identifier>_<params>%}.