From 11392b847b642f64b8bc2ab32d87f37562de3ee6 Mon Sep 17 00:00:00 2001 From: Frank van der Heijden Date: Wed, 4 Aug 2021 00:42:56 +0200 Subject: [PATCH] Remove newlines on /pl command --- .../common/commands/CommandPlugins.java | 24 ++++++++----------- 1 file changed, 10 insertions(+), 14 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 0f24b22..58e53d5 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,7 +7,6 @@ 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.minimessage.Template; public abstract class CommandPlugins, P, C extends ServerUtilsAudience> @@ -27,19 +26,16 @@ public abstract class CommandPlugins, */ protected void handlePlugins(C sender, List

plugins, ListComponentBuilder.Format

pluginFormat) { MessagesResource messages = plugin.getMessagesResource(); - sender.sendMessage(Component.text() - .append(messages.get(MessageKey.PLUGINS_HEADER).toComponent()) - .append(Component.newline()) - .append(messages.get(MessageKey.PLUGINS_PREFIX).toComponent( - Template.of("count", String.valueOf(plugins.size())) - )) - .append(ListComponentBuilder.create(plugins) - .separator(messages.get(MessageKey.PLUGINS_SEPARATOR).toComponent()) - .lastSeparator(messages.get(MessageKey.PLUGINS_LAST_SEPARATOR).toComponent()) - .format(pluginFormat) - .build()) - .append(Component.newline()) - .append(messages.get(MessageKey.PLUGININFO_FOOTER).toComponent()) + + sender.sendMessage(messages.get(MessageKey.PLUGINS_HEADER).toComponent()); + sender.sendMessage(messages.get(MessageKey.PLUGINS_PREFIX).toComponent( + Template.of("count", String.valueOf(plugins.size())) + )); + sender.sendMessage(ListComponentBuilder.create(plugins) + .separator(messages.get(MessageKey.PLUGINS_SEPARATOR).toComponent()) + .lastSeparator(messages.get(MessageKey.PLUGINS_LAST_SEPARATOR).toComponent()) + .format(pluginFormat) .build()); + sender.sendMessage(messages.get(MessageKey.PLUGININFO_FOOTER).toComponent()); } }