mirror of
https://github.com/songoda/EpicEnchants.git
synced 2024-12-23 01:27:43 +01:00
Fix for placeholder api conflict.
This commit is contained in:
parent
68464516fb
commit
b6dc724228
@ -89,8 +89,9 @@ public class Placeholders {
|
||||
return setPlaceholders(input, user, opponent, level, null);
|
||||
}
|
||||
|
||||
public static String setPlaceholders(String input, Player user, LivingEntity opponent, int level, Event event) {
|
||||
AtomicReference<String> output = new AtomicReference<>(input.replace("{level}", "" + level));
|
||||
public static String setPlaceholders(String in, Player user, LivingEntity opponent, int level, Event event) {
|
||||
String input = in.replace("{level}", String.valueOf(level));
|
||||
AtomicReference<String> output = new AtomicReference<>(input);
|
||||
|
||||
PLAYER_FUNCTIONS.forEach((toReplace, function) -> output.updateAndGet(string -> string.replace(toReplace, function.apply(user, opponent).toString())));
|
||||
REGEX_CONSUMERS.forEach(consumer -> consumer.accept(output));
|
||||
@ -99,9 +100,8 @@ public class Placeholders {
|
||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||
output.updateAndGet(string -> PlaceholderAPI.setPlaceholders(user, string));
|
||||
|
||||
if (opponent instanceof Player) {
|
||||
if (opponent instanceof Player)
|
||||
output.updateAndGet(string -> PlaceholderAPI.setRelationalPlaceholders(user, (Player) opponent, input));
|
||||
}
|
||||
}
|
||||
|
||||
return output.get();
|
||||
|
Loading…
Reference in New Issue
Block a user