Remove deprecation for useful methods, set removal of deprecated methods to 2.11.0, registerPlaceholderHook will fail gracefully

This commit is contained in:
extendedclip 2020-07-31 10:35:47 -04:00
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,32 +39,20 @@ 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_PERCENT = new CharsReplacer(Closure.PERCENT);
private static final Replacer REPLACER_BRACKET = new CharsReplacer(Closure.BRACKET); private static final Replacer REPLACER_BRACKET = new CharsReplacer(Closure.BRACKET);
@Deprecated
private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]"); private static final Pattern PLACEHOLDER_PATTERN = Pattern.compile("[%]([^%]+)[%]");
@Deprecated
private static final Pattern BRACKET_PLACEHOLDER_PATTERN = Pattern.compile("[{]([^{}]+)[}]"); private static final Pattern BRACKET_PLACEHOLDER_PATTERN = Pattern.compile("[{]([^{}]+)[}]");
@Deprecated private static final Pattern RELATIONAL_PLACEHOLDER_PATTERN = Pattern
private static final Pattern RELATIONAL_PLACEHOLDER_PATTERN = Pattern.compile("[%](rel_)([^%]+)[%]"); .compile("[%](rel_)([^%]+)[%]");
private PlaceholderAPI() private PlaceholderAPI() {
{
} }
// === Current API === // === Current API ===
/** /**
@ -71,9 +64,10 @@ public final class PlaceholderAPI
* @return String containing all translated placeholders * @return String containing all translated placeholders
*/ */
@NotNull @NotNull
public static String setPlaceholders(@Nullable final OfflinePlayer player, @NotNull final String text) public static String setPlaceholders(@Nullable final OfflinePlayer player,
{ @NotNull final String text) {
return REPLACER_PERCENT.apply(text, player, PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion); return REPLACER_PERCENT.apply(text, player,
PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
} }
/** /**
@ -85,8 +79,8 @@ public final class PlaceholderAPI
* @return String containing all translated placeholders * @return String containing all translated placeholders
*/ */
@NotNull @NotNull
public static List<String> setPlaceholders(@Nullable final OfflinePlayer player, @NotNull final List<@NotNull String> text) 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()); return text.stream().map(line -> setPlaceholders(player, line)).collect(Collectors.toList());
} }
@ -99,9 +93,10 @@ public final class PlaceholderAPI
* @return String containing all translated placeholders * @return String containing all translated placeholders
*/ */
@NotNull @NotNull
public static String setBracketPlaceholders(@Nullable final OfflinePlayer player, @NotNull final String text) public static String setBracketPlaceholders(@Nullable final OfflinePlayer player,
{ @NotNull final String text) {
return REPLACER_BRACKET.apply(text, player, PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion); return REPLACER_BRACKET.apply(text, player,
PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()::getExpansion);
} }
/** /**
@ -113,9 +108,10 @@ public final class PlaceholderAPI
* @return String containing all translated placeholders * @return String containing all translated placeholders
*/ */
@NotNull @NotNull
public static List<String> setBracketPlaceholders(@Nullable final OfflinePlayer player, @NotNull final List<@NotNull String> text) 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()); return text.stream().map(line -> setBracketPlaceholders(player, line))
.collect(Collectors.toList());
} }
@ -125,9 +121,9 @@ public final class PlaceholderAPI
* @param identifier The identifier to check * @param identifier The identifier to check
* @return true if identifier is already registered * @return true if identifier is already registered
*/ */
public static boolean isRegistered(@NotNull final String identifier) public static boolean isRegistered(@NotNull final String identifier) {
{ return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager()
return PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().findExpansionByIdentifier(identifier).isPresent(); .findExpansionByIdentifier(identifier).isPresent();
} }
@ -137,40 +133,56 @@ public final class PlaceholderAPI
* @return All registered placeholder identifiers * @return All registered placeholder identifiers
*/ */
@NotNull @NotNull
public static Set<String> getRegisteredIdentifiers() public static Set<String> getRegisteredIdentifiers() {
{ return ImmutableSet
return ImmutableSet.copyOf(PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getIdentifiers()); .copyOf(PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getIdentifiers());
} }
/**
// === Deprecated API === * Get the normal placeholder pattern.
*/
public static Pattern getPlaceholderPattern() {
return PLACEHOLDER_PATTERN;
}
/** /**
* Check if a String contains any PlaceholderAPI placeholders ({@literal %<identifier>_<params>%}). * Get the bracket placeholder pattern.
*/
public static Pattern getBracketPlaceholderPattern() {
return BRACKET_PLACEHOLDER_PATTERN;
}
/**
* Get the relational placeholder pattern.
*/
public static Pattern getRelationalPlaceholderPattern() {
return RELATIONAL_PLACEHOLDER_PATTERN;
}
/**
* Check if a String contains any PlaceholderAPI placeholders ({@literal
* %<identifier>_<params>%}).
* *
* @param text String to check * @param text String to check
* @return true if String contains any registered placeholder identifiers, false otherwise * @return true if String contains any matches to the normal placeholder pattern, false otherwise
* @deprecated Will be removed in a future release.
*/ */
@Deprecated public static boolean containsPlaceholders(String text) {
public static boolean containsPlaceholders(String text)
{
return text != null && PLACEHOLDER_PATTERN.matcher(text).find(); return text != null && PLACEHOLDER_PATTERN.matcher(text).find();
} }
/** /**
* Check if a String contains any PlaceholderAPI bracket placeholders ({@literal {<identifier>_<params>}}). * Check if a String contains any PlaceholderAPI bracket placeholders ({@literal
* {<identifier>_<params>}}).
* *
* @param text String to check * @param text String to check
* @return true if String contains any registered placeholder identifiers, false otherwise * @return true if String contains any matches to the bracket placeholder pattern, false otherwise
* @deprecated Will be removed in a future release.
*/ */
@Deprecated public static boolean containsBracketPlaceholders(String text) {
public static boolean containsBracketPlaceholders(String text)
{
return text != null && BRACKET_PLACEHOLDER_PATTERN.matcher(text).find(); return text != null && BRACKET_PLACEHOLDER_PATTERN.matcher(text).find();
} }
// === Deprecated API ===
/** /**
* set relational placeholders in the text specified placeholders are matched with the pattern * set relational placeholders in the text specified placeholders are matched with the pattern
* %<rel_(identifier)_(params)>% when set with this method * %<rel_(identifier)_(params)>% when set with this method
@ -182,8 +194,7 @@ public final class PlaceholderAPI
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead. * @deprecated Use {@link #setPlaceholders(OfflinePlayer, String)} instead.
*/ */
@Deprecated @Deprecated
public static String setRelationalPlaceholders(Player one, Player two, String text) public static String setRelationalPlaceholders(Player one, Player two, String text) {
{
return setRelationalPlaceholders(one, two, text, true); return setRelationalPlaceholders(one, two, text, true);
} }
@ -198,8 +209,7 @@ public final class PlaceholderAPI
* @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead. * @deprecated Use {@link #setPlaceholders(OfflinePlayer, List)} instead.
*/ */
@Deprecated @Deprecated
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text) public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text) {
{
return setRelationalPlaceholders(one, two, text, true); return setRelationalPlaceholders(one, two, text, true);
} }
@ -216,10 +226,9 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text, boolean colorize) public static List<String> setRelationalPlaceholders(Player one, Player two, List<String> text,
{ boolean colorize) {
if (text == null) if (text == null) {
{
return null; return null;
} }
@ -242,43 +251,38 @@ public final class PlaceholderAPI
@Deprecated @Deprecated
@SuppressWarnings("DuplicatedCode") @SuppressWarnings("DuplicatedCode")
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setRelationalPlaceholders(Player one, Player two, String text, boolean colorize) public static String setRelationalPlaceholders(Player one, Player two, String text,
{ boolean colorize) {
if (text == null) if (text == null) {
{
return null; return null;
} }
if (PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansionsCount() == 0) if (PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansionsCount() == 0) {
{
return colorize ? Msg.color(text) : text; return colorize ? Msg.color(text) : text;
} }
final Matcher matcher = RELATIONAL_PLACEHOLDER_PATTERN.matcher(text); final Matcher matcher = RELATIONAL_PLACEHOLDER_PATTERN.matcher(text);
while (matcher.find()) while (matcher.find()) {
{
final String format = matcher.group(2); final String format = matcher.group(2);
final int index = format.indexOf("_"); final int index = format.indexOf("_");
if (index <= 0 || index >= format.length()) if (index <= 0 || index >= format.length()) {
{
continue; continue;
} }
String identifier = format.substring(0, index).toLowerCase(); String identifier = format.substring(0, index).toLowerCase();
String params = format.substring(index + 1); String params = format.substring(index + 1);
final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance().getLocalExpansionManager().getExpansion(identifier); final PlaceholderExpansion expansion = PlaceholderAPIPlugin.getInstance()
.getLocalExpansionManager().getExpansion(identifier);
if (!(expansion instanceof Relational)) if (!(expansion instanceof Relational)) {
{
continue; continue;
} }
final String value = ((Relational) expansion).onPlaceholderRequest(one, two, params); final String value = ((Relational) expansion).onPlaceholderRequest(one, two, params);
if (value != null) if (value != null) {
{
text = text.replaceAll(Pattern.quote(matcher.group()), Matcher.quoteReplacement(value)); text = text.replaceAll(Pattern.quote(matcher.group()), Matcher.quoteReplacement(value));
} }
} }
@ -287,42 +291,57 @@ public final class PlaceholderAPI
} }
/** /**
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to register placeholders instead * @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
* register placeholders instead
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static boolean registerPlaceholderHook(Plugin plugin, PlaceholderHook placeholderHook) { 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!" PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
+ " Please reach out to " + plugin.getDescription().getAuthors().toString() + " and let them know that they need to update ASAP!"); + " 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 Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
* register placeholders instead
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static boolean registerPlaceholderHook(String identifier, PlaceholderHook placeholderHook) { public static boolean registerPlaceholderHook(String identifier,
throw new UnsupportedOperationException(identifier + " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!"); PlaceholderHook placeholderHook) {
PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
+ " is attempting to register placeholders via a PlaceholderHook class which is no longer supported!");
return false;
} }
/** /**
* @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to unregister placeholders instead * @deprecated Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
* unregister placeholders instead
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static boolean unregisterPlaceholderHook(Plugin plugin) { 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!" PlaceholderAPIPlugin.getInstance().getLogger().warning(plugin.getName()
+ " Please reach out to " + plugin.getDescription().getAuthors().toString() + " and let them know that they need to update ASAP!"); + " 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 Please use {@link me.clip.placeholderapi.expansion.PlaceholderExpansion} to
* unregister placeholders instead
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static boolean unregisterPlaceholderHook(String identifier) { public static boolean unregisterPlaceholderHook(String identifier) {
throw new UnsupportedOperationException(identifier + " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!"); PlaceholderAPIPlugin.getInstance().getLogger().warning(identifier
+ " is attempting to unregister placeholders through the PlaceholderAPI class which is no longer supported!");
return false;
} }
/** /**
@ -331,8 +350,8 @@ public final class PlaceholderAPI
@NotNull @NotNull
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @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) public static String setPlaceholders(@Nullable final OfflinePlayer player,
{ @NotNull final String text, @NotNull final Pattern pattern, final boolean colorize) {
return setPlaceholders(player, text); return setPlaceholders(player, text);
} }
@ -342,8 +361,8 @@ public final class PlaceholderAPI
@NotNull @NotNull
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @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) 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); return setPlaceholders(player, text);
} }
@ -352,8 +371,8 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text, boolean colorize) public static List<String> setBracketPlaceholders(OfflinePlayer player, List<String> text,
{ boolean colorize) {
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
} }
@ -362,8 +381,8 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text, boolean colorize) public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
{ boolean colorize) {
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
} }
@ -372,8 +391,8 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setPlaceholders(OfflinePlayer player, List<String> text, Pattern pattern) public static List<String> setPlaceholders(OfflinePlayer player, List<String> text,
{ Pattern pattern) {
return setPlaceholders(player, text, pattern, true); return setPlaceholders(player, text, pattern, true);
} }
@ -383,8 +402,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize) public static String setBracketPlaceholders(OfflinePlayer player, String text, boolean colorize) {
{
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
} }
@ -393,8 +411,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize) public static String setPlaceholders(OfflinePlayer player, String text, boolean colorize) {
{
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
} }
@ -403,8 +420,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern) public static String setPlaceholders(OfflinePlayer player, String text, Pattern pattern) {
{
return setPlaceholders(player, text, pattern, true); return setPlaceholders(player, text, pattern, true);
} }
@ -413,38 +429,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static Pattern getPlaceholderPattern() public static Set<String> getRegisteredPlaceholderPlugins() {
{
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(); return getRegisteredIdentifiers();
} }
@ -453,8 +438,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static Set<String> getExternalPlaceholderPlugins() public static Set<String> getExternalPlaceholderPlugins() {
{
return null; return null;
} }
@ -463,8 +447,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setPlaceholders(Player player, String text) public static String setPlaceholders(Player player, String text) {
{
return setPlaceholders(((OfflinePlayer) player), text); return setPlaceholders(((OfflinePlayer) player), text);
} }
@ -473,8 +456,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setPlaceholders(Player player, String text, boolean colorize) public static String setPlaceholders(Player player, String text, boolean colorize) {
{
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
} }
@ -483,8 +465,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setPlaceholders(Player player, List<String> text) public static List<String> setPlaceholders(Player player, List<String> text) {
{
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, true); return setPlaceholders(player, text, PLACEHOLDER_PATTERN, true);
} }
@ -493,8 +474,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize) public static List<String> setPlaceholders(Player player, List<String> text, boolean colorize) {
{
return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, PLACEHOLDER_PATTERN, colorize);
} }
@ -503,8 +483,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setBracketPlaceholders(Player player, String text) public static String setBracketPlaceholders(Player player, String text) {
{
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true); return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
} }
@ -513,8 +492,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static String setBracketPlaceholders(Player player, String text, boolean colorize) public static String setBracketPlaceholders(Player player, String text, boolean colorize) {
{
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
} }
@ -523,8 +501,7 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setBracketPlaceholders(Player player, List<String> text) public static List<String> setBracketPlaceholders(Player player, List<String> text) {
{
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true); return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, true);
} }
@ -533,8 +510,8 @@ public final class PlaceholderAPI
*/ */
@Deprecated @Deprecated
@ApiStatus.ScheduledForRemoval(inVersion = "2.11.0") @ApiStatus.ScheduledForRemoval(inVersion = "2.11.0")
public static List<String> setBracketPlaceholders(Player player, List<String> text, boolean colorize) public static List<String> setBracketPlaceholders(Player player, List<String> text,
{ boolean colorize) {
return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize); return setPlaceholders(player, text, BRACKET_PLACEHOLDER_PATTERN, colorize);
} }