From c1f2b2bcaa1589d51054b97e9d2edaf675add3d4 Mon Sep 17 00:00:00 2001 From: William278 Date: Sun, 10 Sep 2023 16:52:51 +0300 Subject: [PATCH] Improve description format in command list --- .../huskhomes/command/HuskHomesCommand.java | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/common/src/main/java/net/william278/huskhomes/command/HuskHomesCommand.java b/common/src/main/java/net/william278/huskhomes/command/HuskHomesCommand.java index b290f4e0..39a94ac8 100644 --- a/common/src/main/java/net/william278/huskhomes/command/HuskHomesCommand.java +++ b/common/src/main/java/net/william278/huskhomes/command/HuskHomesCommand.java @@ -289,10 +289,13 @@ public class HuskHomesCommand extends Command implements TabProvider { .filter(command -> user.hasPermission(command.getPermission())) .map(command -> plugin.getLocales().getRawLocale("command_list_item", Locales.escapeText(command.getName()), - Locales.escapeText(plugin.getLocales() - .truncateText(command.getDescription(), 50)), - Locales.escapeText(plugin.getLocales() - .wrapText(command.getUsage() + "\n" + command.getDescription(), 40))) + Locales.escapeText( + plugin.getLocales().truncateText(command.getDescription(), 50) + ), + Locales.escapeText(String.format("%s\n\n%s", + plugin.getLocales().wrapText(command.getUsage(), 50), + plugin.getLocales().wrapText(command.getDescription(), 50) + ))) .orElse(command.getName())) .collect(Collectors.toList()), plugin.getLocales().getBaseList(Math.min(plugin.getSettings().getListItemsPerPage(), 6))