mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2025-02-05 15:55:28 +01:00
Remove deprecation for useful methods, set removal of deprecated methods to 2.11.0, registerPlaceholderHook will fail gracefully
This commit is contained in:
parent
d2945539b3
commit
8e3c942282
@ -21,6 +21,11 @@
|
|||||||
package me.clip.placeholderapi;
|
package me.clip.placeholderapi;
|
||||||
|
|
||||||
import com.google.common.collect.ImmutableSet;
|
import com.google.common.collect.ImmutableSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.regex.Matcher;
|
||||||
|
import java.util.regex.Pattern;
|
||||||
|
import java.util.stream.Collectors;
|
||||||
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
import me.clip.placeholderapi.expansion.PlaceholderExpansion;
|
||||||
import me.clip.placeholderapi.expansion.Relational;
|
import me.clip.placeholderapi.expansion.Relational;
|
||||||
import me.clip.placeholderapi.replacer.CharsReplacer;
|
import me.clip.placeholderapi.replacer.CharsReplacer;
|
||||||
@ -34,508 +39,480 @@ import org.jetbrains.annotations.ApiStatus;
|
|||||||
import org.jetbrains.annotations.NotNull;
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.jetbrains.annotations.Nullable;
|
import org.jetbrains.annotations.Nullable;
|
||||||
|
|
||||||
import java.util.List;
|
public final class PlaceholderAPI {
|
||||||
import java.util.Set;
|
|
||||||
import java.util.regex.Matcher;
|
|
||||||
import java.util.regex.Pattern;
|
|
||||||
import java.util.stream.Collectors;
|
|
||||||
|
|
||||||
public final class PlaceholderAPI
|
private static final Replacer REPLACER_PERCENT = new CharsReplacer(Closure.PERCENT);
|
||||||
{
|
private static final Replacer REPLACER_BRACKET = new CharsReplacer(Closure.BRACKET);
|
||||||
|
|
||||||
private static final Replacer REPLACER_PERCENT = new CharsReplacer(Closure.PERCENT);
|
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");
|
||||||
private static final Replacer REPLACER_BRACKET = new CharsReplacer(Closure.BRACKET);
|
private static final Pattern BRACKET_PLACEHOLDER_PATTERN = Pattern.compile("[{]([^{}]+)[}]");
|
||||||
|
private static final Pattern RELATIONAL_PLACEHOLDER_PATTERN = Pattern
|
||||||
|
.compile("[%](rel_)([^%]+)[%]");
|
||||||
|
|
||||||
|
|
||||||
@Deprecated
|
private PlaceholderAPI() {
|
||||||
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");
|
}
|
||||||
@Deprecated
|
|
||||||
private static final Pattern BRACKET_PLACEHOLDER_PATTERN = Pattern.compile("[{]([^{}]+)[}]");
|
// === Current API ===
|
||||||
@Deprecated
|
|
||||||
private static final Pattern RELATIONAL_PLACEHOLDER_PATTERN = Pattern.compile("[%](rel_)([^%]+)[%]");
|
/**
|
||||||
|
* Translates all placeholders into their corresponding values.
|
||||||
|
* <br>The pattern of a valid placeholder is {@literal %<identifier>_<params>%}.
|
||||||
|
*
|
||||||
|
* @param player Player to parse the placeholders against
|
||||||
|
* @param text Text to set the placeholder values in
|
||||||
|
* @return String containing all translated placeholders
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static String setPlaceholders(@Nullable final OfflinePlayer player,
|
||||||
|
@NotNull final String text) {
|
||||||
|
return REPLACER_PERCENT.apply(text, player,
|
||||||
|
PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translates all placeholders into their corresponding values.
|
||||||
|
* <br>The pattern of a valid placeholder is {@literal %<identifier>_<params>%}.
|
||||||
|
*
|
||||||
|
* @param player Player to parse the placeholders against
|
||||||
|
* @param text List of Strings to set the placeholder values in
|
||||||
|
* @return String containing all translated placeholders
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player,
|
||||||
|
@NotNull final List<@NotNull String> text) {
|
||||||
|
return text.stream().map(line -> setPlaceholders(player, line)).collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translates all placeholders into their corresponding values.
|
||||||
|
* <br>The pattern of a valid placeholder is {@literal {<identifier>_<params>}}.
|
||||||
|
*
|
||||||
|
* @param player Player to parse the placeholders against
|
||||||
|
* @param text Text to set the placeholder values in
|
||||||
|
* @return String containing all translated placeholders
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static String setBracketPlaceholders(@Nullable final OfflinePlayer player,
|
||||||
|
@NotNull final String text) {
|
||||||
|
return REPLACER_BRACKET.apply(text, player,
|
||||||
|
PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Translates all placeholders into their corresponding values.
|
||||||
|
* <br>The pattern of a valid placeholder is {@literal {<identifier>_<params>}}.
|
||||||
|
*
|
||||||
|
* @param player Player to parse the placeholders against
|
||||||
|
* @param text List of Strings to set the placeholder values in
|
||||||
|
* @return String containing all translated placeholders
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static List<String> setBracketPlaceholders(@Nullable final OfflinePlayer player,
|
||||||
|
@NotNull final List<@NotNull String> text) {
|
||||||
|
return text.stream().map(line -> setBracketPlaceholders(player, line))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
private PlaceholderAPI()
|
/**
|
||||||
{
|
* Check if a specific placeholder identifier is currently registered
|
||||||
}
|
*
|
||||||
|
* @param identifier The identifier to check
|
||||||
|
* @return true if identifier is already registered
|
||||||
|
*/
|
||||||
|
public static boolean isRegistered(@NotNull final String identifier) {
|
||||||
|
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
|
||||||
|
.findExpansionByIdentifier(identifier).isPresent();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// === Current API ===
|
/**
|
||||||
|
* Get all registered placeholder identifiers
|
||||||
|
*
|
||||||
|
* @return All registered placeholder identifiers
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
public static Set<String> getRegisteredIdentifiers() {
|
||||||
|
return ImmutableSet
|
||||||
|
.copyOf(PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getIdentifiers());
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates all placeholders into their corresponding values.
|
* Get the normal placeholder pattern.
|
||||||
* <br>The pattern of a valid placeholder is {@literal %<identifier>_<params>%}.
|
*/
|
||||||
*
|
public static Pattern getPlaceholderPattern() {
|
||||||
* @param player Player to parse the placeholders against
|
return PLACEHOLDER_PATTERN;
|
||||||
* @param text Text to set the placeholder values in
|
}
|
||||||
* @return String containing all translated placeholders
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public static String setPlaceholders(@Nullable final OfflinePlayer player, @NotNull final String text)
|
|
||||||
{
|
|
||||||
return REPLACER_PERCENT.apply(text, player, PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates all placeholders into their corresponding values.
|
* Get the bracket placeholder pattern.
|
||||||
* <br>The pattern of a valid placeholder is {@literal %<identifier>_<params>%}.
|
*/
|
||||||
*
|
public static Pattern getBracketPlaceholderPattern() {
|
||||||
* @param player Player to parse the placeholders against
|
return BRACKET_PLACEHOLDER_PATTERN;
|
||||||
* @param text List of Strings to set the placeholder values in
|
}
|
||||||
* @return String containing all translated placeholders
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player, @NotNull final List<@NotNull String> text)
|
|
||||||
{
|
|
||||||
return text.stream().map(line -> setPlaceholders(player, line)).collect(Collectors.toList());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates all placeholders into their corresponding values.
|
* Get the relational placeholder pattern.
|
||||||
* <br>The pattern of a valid placeholder is {@literal {<identifier>_<params>}}.
|
*/
|
||||||
*
|
public static Pattern getRelationalPlaceholderPattern() {
|
||||||
* @param player Player to parse the placeholders against
|
return RELATIONAL_PLACEHOLDER_PATTERN;
|
||||||
* @param text Text to set the placeholder values in
|
}
|
||||||
* @return String containing all translated placeholders
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
public static String setBracketPlaceholders(@Nullable final OfflinePlayer player, @NotNull final String text)
|
|
||||||
{
|
|
||||||
return REPLACER_BRACKET.apply(text, player, PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translates all placeholders into their corresponding values.
|
* Check if a String contains any PlaceholderAPI placeholders ({@literal
|
||||||
* <br>The pattern of a valid placeholder is {@literal {<identifier>_<params>}}.
|
* %<identifier>_<params>%}).
|
||||||
*
|
*
|
||||||
* @param player Player to parse the placeholders against
|
* @param text String to check
|
||||||
* @param text List of Strings to set the placeholder values in
|
* @return true if String contains any matches to the normal placeholder pattern, false otherwise
|
||||||
* @return String containing all translated placeholders
|
*/
|
||||||
*/
|
public static boolean containsPlaceholders(String text) {
|
||||||
@NotNull
|
return text != null && PLACEHOLDER_PATTERN.matcher(text).find();
|
||||||
public static List<String> setBracketPlaceholders(@Nullable final OfflinePlayer player, @NotNull final List<@NotNull String> text)
|
}
|
||||||
{
|
|
||||||
return text.stream().map(line -> setBracketPlaceholders(player, line)).collect(Collectors.toList());
|
/**
|
||||||
}
|
* Check if a String contains any PlaceholderAPI bracket placeholders ({@literal
|
||||||
|
* {<identifier>_<params>}}).
|
||||||
|
*
|
||||||
|
* @param text String to check
|
||||||
|
* @return true if String contains any matches to the bracket placeholder pattern, false otherwise
|
||||||
|
*/
|
||||||
|
public static boolean containsBracketPlaceholders(String text) {
|
||||||
|
return text != null && BRACKET_PLACEHOLDER_PATTERN.matcher(text).find();
|
||||||
|
}
|
||||||
|
|
||||||
|
// === Deprecated API ===
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set relational placeholders in the text specified placeholders are matched with the pattern
|
||||||
|
* %<rel_(identifier)_(params)>% when set with this method
|
||||||
|
*
|
||||||
|
* @param one First player to compare
|
||||||
|
* @param two Second player to compare
|
||||||
|
* @param text Text to parse the placeholders in
|
||||||
|
* @return The text containing the parsed relational placeholders
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public static String setRelationalPlaceholders(Player one, Player two, String text) {
|
||||||
|
return setRelationalPlaceholders(one, two, text, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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>_<param>%}.
|
||||||
|
*
|
||||||
|
* @param one Player to compare
|
||||||
|
* @param two Player to compare
|
||||||
|
* @param text text to parse the placeholder values to
|
||||||
|
* @return The text containing the parsed relational placeholders
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text) {
|
||||||
|
return setRelationalPlaceholders(one, two, text, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 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>%}.
|
||||||
|
*
|
||||||
|
* @param one First player to compare
|
||||||
|
* @param two Second player to compare
|
||||||
|
* @param text Text to parse the placeholders in
|
||||||
|
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
||||||
|
* @return The text containing the parsed relational placeholders
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text,
|
||||||
|
boolean colorize) {
|
||||||
|
if (text == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return text.stream()
|
||||||
|
.map(line -> setRelationalPlaceholders(one, two, line, colorize))
|
||||||
|
.collect(Collectors.toList());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* set relational placeholders in the text specified placeholders are matched with the pattern
|
||||||
|
* %<rel_(identifier)_(params)>% when set with this method
|
||||||
|
*
|
||||||
|
* @param one Player to compare
|
||||||
|
* @param two Player to compare
|
||||||
|
* @param text Text to parse the placeholders in
|
||||||
|
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
||||||
|
* @return The text containing the parsed relational placeholders
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@SuppressWarnings("DuplicatedCode")
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static String setRelationalPlaceholders(Player one, Player two, String text,
|
||||||
|
boolean colorize) {
|
||||||
|
if (text == null) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansionsCount() == 0) {
|
||||||
|
return colorize ? Msg.color(text) : text;
|
||||||
|
}
|
||||||
|
|
||||||
|
final Matcher matcher = RELATIONAL_PLACEHOLDER_PATTERN.matcher(text);
|
||||||
|
|
||||||
|
while (matcher.find()) {
|
||||||
|
final String format = matcher.group(2);
|
||||||
|
final int index = format.indexOf("_");
|
||||||
|
|
||||||
|
if (index <= 0 || index >= format.length()) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
String identifier = format.substring(0, index).toLowerCase();
|
||||||
|
String params = format.substring(index + 1);
|
||||||
|
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance()
|
||||||
|
.getLocalExpansionManager().getExpansion(identifier);
|
||||||
|
|
||||||
|
if (!(expansion instanceof Relational)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
final String value = ((Relational) expansion).onPlaceholderRequest(one, two, params);
|
||||||
|
|
||||||
|
if (value != null) {
|
||||||
|
text = text.replaceAll(Pattern.quote(matcher.group()), Matcher.quoteReplacement(value));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return colorize ? Msg.color(text) : text;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||||
|
* register placeholders instead
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) {
|
||||||
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
||||||
|
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!"
|
||||||
|
+ " Please reach out to " + plugin.getDescription().getAuthors().toString()
|
||||||
|
+ " and let them know that they need to update ASAP!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||||
|
* register placeholders instead
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static boolean registerPlaceholderHook(String identifier,
|
||||||
|
PlaceholderHook placeholderHook) {
|
||||||
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
||||||
|
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a specific placeholder identifier is currently registered
|
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||||
*
|
* unregister placeholders instead
|
||||||
* @param identifier The identifier to check
|
*/
|
||||||
* @return true if identifier is already registered
|
@Deprecated
|
||||||
*/
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
public static boolean isRegistered(@NotNull final String identifier)
|
public static boolean unregisterPlaceholderHook(Plugin plugin) {
|
||||||
{
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
|
||||||
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().findExpansionByIdentifier(identifier).isPresent();
|
+ " is attempting to unregister placeholders via the PlaceholderAPI class which is no longer supported!"
|
||||||
}
|
+ " Please reach out to " + plugin.getDescription().getAuthors().toString()
|
||||||
|
+ " and let them know that they need to update ASAP!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
|
||||||
|
* unregister placeholders instead
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static boolean unregisterPlaceholderHook(String identifier) {
|
||||||
|
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
|
||||||
|
+ " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!");
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, String)} instead
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static String setPlaceholders(@Nullable final OfflinePlayer player,
|
||||||
|
@NotNull final String text, @NotNull final Pattern pattern, final boolean colorize) {
|
||||||
|
return setPlaceholders(player, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, List)} instead
|
||||||
|
*/
|
||||||
|
@NotNull
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player,
|
||||||
|
@NotNull final List<String> text, @NotNull final Pattern pattern, final boolean colorize) {
|
||||||
|
return setPlaceholders(player, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text,
|
||||||
|
boolean colorize) {
|
||||||
|
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
||||||
|
boolean colorize) {
|
||||||
|
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
|
||||||
|
Pattern pattern) {
|
||||||
|
return setPlaceholders(player, text, pattern, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get all registered placeholder identifiers
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
*
|
*/
|
||||||
* @return All registered placeholder identifiers
|
@Deprecated
|
||||||
*/
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
@NotNull
|
public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
||||||
public static Set<String> getRegisteredIdentifiers()
|
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||||
{
|
}
|
||||||
return ImmutableSet.copyOf(PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getIdentifiers());
|
|
||||||
}
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize) {
|
||||||
|
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||||
|
}
|
||||||
|
|
||||||
// === Deprecated API ===
|
/**
|
||||||
|
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern) {
|
||||||
|
return setPlaceholders(player, text, pattern, true);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a String contains any PlaceholderAPI placeholders ({@literal %<identifier>_<params>%}).
|
* @deprecated Will be removed in a future release.
|
||||||
*
|
*/
|
||||||
* @param text String to check
|
@Deprecated
|
||||||
* @return true if String contains any registered placeholder identifiers, false otherwise
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
* @deprecated Will be removed in a future release.
|
public static Set<String> getRegisteredPlaceholderPlugins() {
|
||||||
*/
|
return getRegisteredIdentifiers();
|
||||||
@Deprecated
|
}
|
||||||
public static boolean containsPlaceholders(String text)
|
|
||||||
{
|
|
||||||
return text != null && PLACEHOLDER_PATTERN.matcher(text).find();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if a String contains any PlaceholderAPI bracket placeholders ({@literal {<identifier>_<params>}}).
|
* @deprecated Will be removed in a future release.
|
||||||
*
|
*/
|
||||||
* @param text String to check
|
@Deprecated
|
||||||
* @return true if String contains any registered placeholder identifiers, false otherwise
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
* @deprecated Will be removed in a future release.
|
public static Set<String> getExternalPlaceholderPlugins() {
|
||||||
*/
|
return null;
|
||||||
@Deprecated
|
}
|
||||||
public static boolean containsBracketPlaceholders(String text)
|
|
||||||
{
|
|
||||||
return text != null && BRACKET_PLACEHOLDER_PATTERN.matcher(text).find();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set relational placeholders in the text specified placeholders are matched with the pattern
|
* @deprecated Will be removed in a future release.
|
||||||
* %<rel_(identifier)_(params)>% when set with this method
|
*/
|
||||||
*
|
@Deprecated
|
||||||
* @param one First player to compare
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
* @param two Second player to compare
|
public static String setPlaceholders(Player player, String text) {
|
||||||
* @param text Text to parse the placeholders in
|
return setPlaceholders(((OfflinePlayer) player), text);
|
||||||
* @return The text containing the parsed relational placeholders
|
}
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static String setRelationalPlaceholders(Player one, Player two, String text)
|
|
||||||
{
|
|
||||||
return setRelationalPlaceholders(one, two, text, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate placeholders in the provided List based on the relation of the two provided players.
|
* @deprecated Will be removed in a future release.
|
||||||
* <br>The pattern of a valid placeholder is {@literal %rel_<identifier>_<param>%}.
|
*/
|
||||||
*
|
@Deprecated
|
||||||
* @param one Player to compare
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
* @param two Player to compare
|
public static String setPlaceholders(Player player, String text, boolean colorize) {
|
||||||
* @param text text to parse the placeholder values to
|
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||||
* @return The text containing the parsed relational placeholders
|
}
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text)
|
|
||||||
{
|
|
||||||
return setRelationalPlaceholders(one, two, text, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Translate placeholders in the provided list based on the relation of the two provided players.
|
* @deprecated Will be removed in a future release.
|
||||||
* <br>The pattern of a valid placeholder is {@literal %rel_<identifier>_<params>%}.
|
*/
|
||||||
*
|
@Deprecated
|
||||||
* @param one First player to compare
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
* @param two Second player to compare
|
public static List<String> setPlaceholders(Player player, List<String> text) {
|
||||||
* @param text Text to parse the placeholders in
|
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, true);
|
||||||
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
}
|
||||||
* @return The text containing the parsed relational placeholders
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text, boolean colorize)
|
|
||||||
{
|
|
||||||
if (text == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
return text.stream()
|
/**
|
||||||
.map(line -> setRelationalPlaceholders(one, two, line, colorize))
|
* @deprecated Will be removed in a future release.
|
||||||
.collect(Collectors.toList());
|
*/
|
||||||
}
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize) {
|
||||||
|
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* set relational placeholders in the text specified placeholders are matched with the pattern
|
* @deprecated Will be removed in a future release.
|
||||||
* %<rel_(identifier)_(params)>% when set with this method
|
*/
|
||||||
*
|
@Deprecated
|
||||||
* @param one Player to compare
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
* @param two Player to compare
|
public static String setBracketPlaceholders(Player player, String text) {
|
||||||
* @param text Text to parse the placeholders in
|
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
|
||||||
* @param colorize If color codes (&[0-1a-fk-o]) should be translated
|
}
|
||||||
* @return The text containing the parsed relational placeholders
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@SuppressWarnings("DuplicatedCode")
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setRelationalPlaceholders(Player one, Player two, String text, boolean colorize)
|
|
||||||
{
|
|
||||||
if (text == null)
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansionsCount() == 0)
|
/**
|
||||||
{
|
* @deprecated Will be removed in a future release.
|
||||||
return colorize ? Msg.color(text) : text;
|
*/
|
||||||
}
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static String setBracketPlaceholders(Player player, String text, boolean colorize) {
|
||||||
|
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||||
|
}
|
||||||
|
|
||||||
final Matcher matcher = RELATIONAL_PLACEHOLDER_PATTERN.matcher(text);
|
/**
|
||||||
|
* @deprecated Will be removed in a future release.
|
||||||
|
*/
|
||||||
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
|
public static List<String> setBracketPlaceholders(Player player, List<String> text) {
|
||||||
|
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
|
||||||
|
}
|
||||||
|
|
||||||
while (matcher.find())
|
/**
|
||||||
{
|
* @deprecated Will be removed in a future release.
|
||||||
final String format = matcher.group(2);
|
*/
|
||||||
final int index = format.indexOf("_");
|
@Deprecated
|
||||||
|
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
||||||
if (index <= 0 || index >= format.length())
|
public static List<String> setBracketPlaceholders(Player player, List<String> text,
|
||||||
{
|
boolean colorize) {
|
||||||
continue;
|
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
||||||
}
|
}
|
||||||
|
|
||||||
String identifier = format.substring(0, index).toLowerCase();
|
|
||||||
String params = format.substring(index + 1);
|
|
||||||
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansion(identifier);
|
|
||||||
|
|
||||||
if (!(expansion instanceof Relational))
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
final String value = ((Relational) expansion).onPlaceholderRequest(one, two, params);
|
|
||||||
|
|
||||||
if (value != null)
|
|
||||||
{
|
|
||||||
text = text.replaceAll(Pattern.quote(matcher.group()), Matcher.quoteReplacement(value));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return colorize ? Msg.color(text) : text;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to register placeholders instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) {
|
|
||||||
throw new UnsupportedOperationException(plugin.getName() + " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!"
|
|
||||||
+ " Please reach out to " + plugin.getDescription().getAuthors().toString() + " and let them know that they need to update ASAP!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to register placeholders instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static boolean registerPlaceholderHook(String identifier, PlaceholderHook placeholderHook) {
|
|
||||||
throw new UnsupportedOperationException(identifier + " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to unregister placeholders instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static boolean unregisterPlaceholderHook(Plugin plugin) {
|
|
||||||
throw new UnsupportedOperationException(plugin.getName() + " is attempting to unregister placeholders via the PlaceholderAPI class which is no longer supported!"
|
|
||||||
+ " Please reach out to " + plugin.getDescription().getAuthors().toString() + " and let them know that they need to update ASAP!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to unregister placeholders instead
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static boolean unregisterPlaceholderHook(String identifier) {
|
|
||||||
throw new UnsupportedOperationException(identifier + " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!");
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, String)} instead
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setPlaceholders(@Nullable final OfflinePlayer player, @NotNull final String text, @NotNull final Pattern pattern, final boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Please use {@link #setPlaceholders(OfflinePlayer, List)} instead
|
|
||||||
*/
|
|
||||||
@NotNull
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player, @NotNull final List<String> text, @NotNull final Pattern pattern, final boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text, Pattern pattern)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, pattern, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, pattern, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static Pattern getPlaceholderPattern()
|
|
||||||
{
|
|
||||||
return PLACEHOLDER_PATTERN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static Pattern getBracketPlaceholderPattern()
|
|
||||||
{
|
|
||||||
return BRACKET_PLACEHOLDER_PATTERN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static Pattern getRelationalPlaceholderPattern()
|
|
||||||
{
|
|
||||||
return RELATIONAL_PLACEHOLDER_PATTERN;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static Set<String> getRegisteredPlaceholderPlugins()
|
|
||||||
{
|
|
||||||
return getRegisteredIdentifiers();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static Set<String> getExternalPlaceholderPlugins()
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setPlaceholders(Player player, String text)
|
|
||||||
{
|
|
||||||
return setPlaceholders(((OfflinePlayer) player), text);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setPlaceholders(Player player, String text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setPlaceholders(Player player, List<String> text)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setBracketPlaceholders(Player player, String text)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static String setBracketPlaceholders(Player player, String text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setBracketPlaceholders(Player player, List<String> text)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @deprecated Will be removed in a future release.
|
|
||||||
*/
|
|
||||||
@Deprecated
|
|
||||||
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
|
|
||||||
public static List<String> setBracketPlaceholders(Player player, List<String> text, boolean colorize)
|
|
||||||
{
|
|
||||||
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user