From ae6f361ac112d5bc5c427c1cab10594d9fd09161 Mon Sep 17 00:00:00 2001 From: Frank van der Heijden Date: Wed, 4 Aug 2021 02:39:50 +0200 Subject: [PATCH] /pl improvement --- .../serverutils/common/commands/CommandPlugins.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandPlugins.java b/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandPlugins.java index 58e53d5..1b34de4 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandPlugins.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandPlugins.java @@ -7,6 +7,8 @@ import net.frankheijden.serverutils.common.config.MessagesResource; import net.frankheijden.serverutils.common.entities.ServerUtilsAudience; import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin; import net.frankheijden.serverutils.common.utils.ListComponentBuilder; +import net.kyori.adventure.text.Component; +import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.minimessage.Template; public abstract class CommandPlugins, P, C extends ServerUtilsAudience> @@ -28,14 +30,16 @@ public abstract class CommandPlugins, MessagesResource messages = plugin.getMessagesResource(); sender.sendMessage(messages.get(MessageKey.PLUGINS_HEADER).toComponent()); - sender.sendMessage(messages.get(MessageKey.PLUGINS_PREFIX).toComponent( + TextComponent.Builder builder = Component.text(); + builder.append(messages.get(MessageKey.PLUGINS_PREFIX).toComponent( Template.of("count", String.valueOf(plugins.size())) )); - sender.sendMessage(ListComponentBuilder.create(plugins) + builder.append(ListComponentBuilder.create(plugins) .separator(messages.get(MessageKey.PLUGINS_SEPARATOR).toComponent()) .lastSeparator(messages.get(MessageKey.PLUGINS_LAST_SEPARATOR).toComponent()) .format(pluginFormat) .build()); + sender.sendMessage(builder.build()); sender.sendMessage(messages.get(MessageKey.PLUGININFO_FOOTER).toComponent()); } }