Skip to content

Commit

Permalink
Fixed problem with placeholder replacements
Browse files Browse the repository at this point in the history
  • Loading branch information
alexdev03 committed Dec 15, 2024
1 parent d47ee75 commit a14c8eb
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public static CompletableFuture<String> replace(@NotNull String format, @NotNull

final Pair<String, Map<String, String>> replaced = replaceInternal(format, plugin, player);
if (!PLACEHOLDER_PATTERN.matcher(replaced.first()).find()) {
return CompletableFuture.completedFuture(replaced.first());
return CompletableFuture.completedFuture(applyPlaceholderReplacements(format, player, replaced.second()));
}

final List<String> placeholders = extractPlaceholders(replaced.first());
Expand All @@ -296,7 +296,8 @@ public static CompletableFuture<String> replace(@NotNull String format, @NotNull
return Map.of();
})
)
.orElse(CompletableFuture.completedFuture(Maps.newHashMap())).exceptionally(e -> {
.orElse(CompletableFuture.completedFuture(Maps.newHashMap()))
.exceptionally(e -> {
plugin.log(Level.ERROR, "An error occurred whilst parsing placeholders: " + e.getMessage());
return Map.of();
})
Expand Down

0 comments on commit a14c8eb

Please sign in to comment.