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:
|
variables:
|
||||||
name: "EpicEnchants"
|
name: "EpicEnchants"
|
||||||
path: "/builds/$CI_PROJECT_PATH"
|
path: "/builds/$CI_PROJECT_PATH"
|
||||||
version: "1.0.9"
|
version: "1.0.10"
|
||||||
|
|
||||||
build:
|
build:
|
||||||
stage: build
|
stage: build
|
||||||
|
@ -89,8 +89,9 @@ public class Placeholders {
|
|||||||
return setPlaceholders(input, user, opponent, level, null);
|
return setPlaceholders(input, user, opponent, level, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String setPlaceholders(String input, Player user, LivingEntity opponent, int level, Event event) {
|
public static String setPlaceholders(String in, Player user, LivingEntity opponent, int level, Event event) {
|
||||||
AtomicReference<String> output = new AtomicReference<>(input.replace("{level}", "" + level));
|
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())));
|
PLAYER_FUNCTIONS.forEach((toReplace, function) -> output.updateAndGet(string -> string.replace(toReplace, function.apply(user, opponent).toString())));
|
||||||
REGEX_CONSUMERS.forEach(consumer -> consumer.accept(output));
|
REGEX_CONSUMERS.forEach(consumer -> consumer.accept(output));
|
||||||
@ -99,9 +100,8 @@ public class Placeholders {
|
|||||||
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
if (Bukkit.getPluginManager().isPluginEnabled("PlaceholderAPI")) {
|
||||||
output.updateAndGet(string -> PlaceholderAPI.setPlaceholders(user, string));
|
output.updateAndGet(string -> PlaceholderAPI.setPlaceholders(user, string));
|
||||||
|
|
||||||
if (opponent instanceof Player) {
|
if (opponent instanceof Player)
|
||||||
output.updateAndGet(string -> PlaceholderAPI.setRelationalPlaceholders(user, (Player) opponent, input));
|
output.updateAndGet(string -> PlaceholderAPI.setRelationalPlaceholders(user, (Player) opponent, input));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return output.get();
|
return output.get();
|
||||||
|
Loading…
Reference in New Issue
Block a user