mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2026-02-26 05:51:12 +01:00
Refactor placeholder methods to use ArrayList for compatibility | I used immutable list by error :(
This commit is contained in:
@@ -80,12 +80,11 @@ public final class PlaceholderAPI {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static List<String> setPlaceholders(final OfflinePlayer player,
|
public static List<String> setPlaceholders(final OfflinePlayer player,
|
||||||
@NotNull final List<String> text) {
|
@NotNull final List<String> text) {
|
||||||
final String[] parsed = new String[text.size()];
|
final List<String> result = new ArrayList<>(text.size());
|
||||||
int i = 0;
|
|
||||||
for (final String line : text) {
|
for (final String line : text) {
|
||||||
parsed[i++] = setPlaceholders(player, line);
|
result.add(setPlaceholders(player, line));
|
||||||
}
|
}
|
||||||
return Arrays.asList(parsed);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -140,12 +139,11 @@ public final class PlaceholderAPI {
|
|||||||
@NotNull
|
@NotNull
|
||||||
public static List<@NotNull String> setBracketPlaceholders(final OfflinePlayer player,
|
public static List<@NotNull String> setBracketPlaceholders(final OfflinePlayer player,
|
||||||
@NotNull final List<@NotNull String> text) {
|
@NotNull final List<@NotNull String> text) {
|
||||||
final String[] parsed = new String[text.size()];
|
final List<String> result = new ArrayList<>(text.size());
|
||||||
int i = 0;
|
|
||||||
for (final String line : text) {
|
for (final String line : text) {
|
||||||
parsed[i++] = setBracketPlaceholders(player, line);
|
result.add(setBracketPlaceholders(player, line));
|
||||||
}
|
}
|
||||||
return Arrays.asList(parsed);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -223,12 +221,11 @@ public final class PlaceholderAPI {
|
|||||||
* @return The text containing the parsed relational placeholders
|
* @return The text containing the parsed relational placeholders
|
||||||
*/
|
*/
|
||||||
public static List<String> setRelationalPlaceholders(final Player one, final Player two, final @NotNull List<String> text) {
|
public static List<String> setRelationalPlaceholders(final Player one, final Player two, final @NotNull List<String> text) {
|
||||||
final String[] parsed = new String[text.size()];
|
final List<String> result = new ArrayList<>(text.size());
|
||||||
int i = 0;
|
|
||||||
for (final String line : text) {
|
for (final String line : text) {
|
||||||
parsed[i++] = setRelationalPlaceholders(one, two, line);
|
result.add(setRelationalPlaceholders(one, two, line));
|
||||||
}
|
}
|
||||||
return Arrays.asList(parsed);
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user