mirror of
https://github.com/songoda/EpicEnchants.git
synced 2024-12-23 01:27:43 +01:00
Merge branch 'development'
This commit is contained in:
commit
2d17cbb868
@ -4,7 +4,7 @@ stages:
|
||||
variables:
|
||||
name: "EpicEnchants"
|
||||
path: "/builds/$CI_PROJECT_PATH"
|
||||
version: "1.0.9"
|
||||
version: "1.0.10"
|
||||
|
||||
build:
|
||||
stage: build
|
||||
|
@ -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,10 +100,9 @@ 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