Skip to content

Commit

Permalink
woopsies actually listen to errors
Browse files Browse the repository at this point in the history
Took 42 seconds
  • Loading branch information
Oribuin committed Sep 3, 2024
1 parent a71ec8b commit e5aebed
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void open(Player player) {
if (warp.getDescription().isEmpty()) continue;

// Add the description to the lore
warp.getDescription().forEach(line -> newLore.add(this.locale.safeFormat(player, line, placeholders)));
warp.getDescription().forEach(line -> newLore.add(this.locale.safeFormat(line, placeholders)));
}

ItemStack newIcon = new ItemBuilder(warpIcon)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,20 +133,19 @@ public String format(CommandSender sender, String message, StringPlaceholders pl
/**
* Format a string with placeholders but no PlaceholderAPI Support
*
* @param sender The CommandSender to send the message to
* @param message The message to send
* @param placeholders The placeholders to apply to the message
*
* @return The formatted string
*/
public String safeFormat(CommandSender sender, String message, StringPlaceholders placeholders) {
public String safeFormat(String message, StringPlaceholders placeholders) {
if (message == null || message.isEmpty())
return "";

if (placeholders == null)
placeholders = StringPlaceholders.empty();

return HexUtils.colorify(sender, placeholders.apply(message));
return HexUtils.colorify(placeholders.apply(message));
}

/**
Expand Down

0 comments on commit e5aebed

Please sign in to comment.