diff --git a/Bukkit/src/main/java/net/frankheijden/serverutils/bukkit/commands/BukkitCommandServerUtils.java b/Bukkit/src/main/java/net/frankheijden/serverutils/bukkit/commands/BukkitCommandServerUtils.java index f22fe9e..e472e87 100644 --- a/Bukkit/src/main/java/net/frankheijden/serverutils/bukkit/commands/BukkitCommandServerUtils.java +++ b/Bukkit/src/main/java/net/frankheijden/serverutils/bukkit/commands/BukkitCommandServerUtils.java @@ -98,7 +98,7 @@ public class BukkitCommandServerUtils extends CommandServerUtils plugins = Arrays.asList(context.get("plugins")); PluginResults enableResults = plugin.getPluginManager().enablePlugins(plugins); - sender.sendMessage(enableResults.toComponent(BukkitMessageKey.ENABLEPLUGIN)); + enableResults.sendTo(sender, BukkitMessageKey.ENABLEPLUGIN); } private void handleDisablePlugin(CommandContext context) { @@ -110,7 +110,7 @@ public class BukkitCommandServerUtils extends CommandServerUtils disableResults = plugin.getPluginManager().disablePlugins(plugins); - sender.sendMessage(disableResults.toComponent(BukkitMessageKey.DISABLEPLUGIN)); + disableResults.sendTo(sender, BukkitMessageKey.DISABLEPLUGIN); } private void handleReloadConfig(CommandContext context) { @@ -166,25 +166,25 @@ public class BukkitCommandServerUtils extends CommandServerUtils b.addAll(description.getAuthors()))) - .add("Description", description.getDescription()) - .add("Main", description.getMain()) - .add("Prefix", description.getPrefix()) - .add("Load Order", description.getLoad().name()) - .add("Load Before", listBuilderFunction.apply(b -> b.addAll(description.getLoadBefore()))) - .add("Depend", listBuilderFunction.apply(b -> b.addAll(description.getDepend()))) - .add("Soft Depend", listBuilderFunction.apply(b -> b.addAll(description.getSoftDepend()))); + builder.key("Name").value(bukkitPlugin.getName()) + .key("Full Name").value(description.getFullName()) + .key("Version").value(description.getVersion()) + .key("Website").value(description.getWebsite()) + .key("Authors").value(listBuilderFunction.apply(b -> b.addAll(description.getAuthors()))) + .key("Description").value(description.getDescription()) + .key("Main").value(description.getMain()) + .key("Prefix").value(description.getPrefix()) + .key("Load Order").value(description.getLoad().name()) + .key("Load Before").value(listBuilderFunction.apply(b -> b.addAll(description.getLoadBefore()))) + .key("Depend").value(listBuilderFunction.apply(b -> b.addAll(description.getDepend()))) + .key("Soft Depend").value(listBuilderFunction.apply(b -> b.addAll(description.getSoftDepend()))); if (MinecraftReflectionVersion.MINOR >= 13) { - builder.add("API Version", description.getAPIVersion()); + builder.key("API Version").value(description.getAPIVersion()); } if (MinecraftReflectionVersion.MINOR >= 15) { - builder.add("Provides", listBuilderFunction.apply(b -> b.addAll(description.getProvides()))); + builder.key("Provides").value(listBuilderFunction.apply(b -> b.addAll(description.getProvides()))); } return builder; @@ -197,17 +197,17 @@ public class BukkitCommandServerUtils extends CommandServerUtils b.addAll(cmd.getAliases()))) - .add("Usage", cmd.getUsage()) - .add("Description", cmd.getDescription()) - .add("Label", cmd.getLabel()) - .add("Permission", cmd.getPermission()) - .add("Permission Message", cmd.getPermissionMessage()); + return builder.key("Aliases").value(listBuilderFunction.apply(b -> b.addAll(cmd.getAliases()))) + .key("Usage").value(cmd.getUsage()) + .key("Description").value(cmd.getDescription()) + .key("Label").value(cmd.getLabel()) + .key("Permission").value(cmd.getPermission()) + .key("Permission Message").value(cmd.getPermissionMessage()); } } diff --git a/Bungee/src/main/java/net/frankheijden/serverutils/bungee/commands/BungeeCommandServerUtils.java b/Bungee/src/main/java/net/frankheijden/serverutils/bungee/commands/BungeeCommandServerUtils.java index 2199108..0302f73 100644 --- a/Bungee/src/main/java/net/frankheijden/serverutils/bungee/commands/BungeeCommandServerUtils.java +++ b/Bungee/src/main/java/net/frankheijden/serverutils/bungee/commands/BungeeCommandServerUtils.java @@ -32,14 +32,14 @@ public class BungeeCommandServerUtils extends CommandServerUtils b.addAll(desc.getDepends()))) - .add("Soft Depend", listBuilderFunction.apply(b -> b.addAll(desc.getSoftDepends()))); + .key("Name").value(desc.getName()) + .key("Version").value(desc.getVersion()) + .key("Author").value(desc.getAuthor()) + .key("Description").value(desc.getDescription()) + .key("Main").value(desc.getMain()) + .key("File").value(desc.getFile().getName()) + .key("Depend").value(listBuilderFunction.apply(b -> b.addAll(desc.getDepends()))) + .key("Soft Depend").value(listBuilderFunction.apply(b -> b.addAll(desc.getSoftDepends()))); } @Override @@ -54,7 +54,7 @@ public class BungeeCommandServerUtils extends CommandServerUtils" : plugin.getDescription().getName()) - .add("Aliases", listBuilderFunction.apply(b -> b.addAll(Arrays.asList(cmd.getAliases())))) - .add("Permission", cmd.getPermission()); + .key("Name").value(cmd.getName()) + .key("Plugin").value(plugin == null ? "" : plugin.getDescription().getName()) + .key("Aliases").value(listBuilderFunction.apply(b -> b.addAll(Arrays.asList(cmd.getAliases())))) + .key("Permission").value(cmd.getPermission()); } } diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/ServerUtilsApp.java b/Common/src/main/java/net/frankheijden/serverutils/common/ServerUtilsApp.java index c41b721..37de8aa 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/ServerUtilsApp.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/ServerUtilsApp.java @@ -10,7 +10,6 @@ import net.frankheijden.serverutils.common.entities.results.PluginResult; import net.frankheijden.serverutils.common.entities.ServerUtilsAudience; import net.frankheijden.serverutils.common.entities.ServerUtilsPlugin; import net.frankheijden.serverutils.common.tasks.UpdateCheckerTask; -import net.kyori.adventure.text.Component; public class ServerUtilsApp, P, T, C extends ServerUtilsAudience, S, D extends ServerUtilsPluginDescription> { @@ -66,15 +65,13 @@ public class ServerUtilsApp, P, T, C File file = plugin.getPluginManager().getPluginFile(updaterPlugin); PluginResult

disableResult = plugin.getPluginManager().disablePlugin(updaterPlugin); if (!disableResult.isSuccess()) { - Component component = disableResult.toComponent(null); - plugin.getChatProvider().getConsoleServerAudience().sendMessage(component); + disableResult.sendTo(plugin.getChatProvider().getConsoleServerAudience(), null); return; } CloseablePluginResult

unloadResult = plugin.getPluginManager().unloadPlugin(disableResult.getPlugin()); if (!unloadResult.isSuccess()) { - Component component = unloadResult.toComponent(null); - plugin.getChatProvider().getConsoleServerAudience().sendMessage(component); + unloadResult.sendTo(plugin.getChatProvider().getConsoleServerAudience(), null); return; } diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandServerUtils.java b/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandServerUtils.java index 7ef6eea..7c9ce36 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandServerUtils.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/commands/CommandServerUtils.java @@ -97,9 +97,7 @@ public abstract class CommandServerUtils loadResults = pluginManager.loadPlugins(jarFiles); if (!loadResults.isSuccess()) { PluginResult

failedResult = loadResults.last(); - sender.sendMessage(failedResult.toComponent(null)); + failedResult.sendTo(sender, null); return; } PluginResults

enableResults = pluginManager.enablePlugins(loadResults.getPlugins()); - sender.sendMessage(enableResults.toComponent(MessageKey.LOADPLUGIN)); + enableResults.sendTo(sender, MessageKey.LOADPLUGIN); } private void handleUnloadPlugin(CommandContext context) { @@ -199,14 +196,14 @@ public abstract class CommandServerUtils disableResults = plugin.getPluginManager().disablePlugins(plugins); for (PluginResult

disableResult : disableResults.getResults()) { if (!disableResult.isSuccess() && disableResult.getResult() != Result.ALREADY_DISABLED) { - sender.sendMessage(disableResult.toComponent(null)); + disableResult.sendTo(sender, null); return; } } CloseablePluginResults

unloadResults = plugin.getPluginManager().unloadPlugins(plugins); unloadResults.tryClose(); - sender.sendMessage(unloadResults.toComponent(MessageKey.UNLOADPLUGIN)); + unloadResults.sendTo(sender, MessageKey.UNLOADPLUGIN); } private void handleReloadPlugin(CommandContext context) { @@ -218,7 +215,7 @@ public abstract class CommandServerUtils reloadResults = plugin.getPluginManager().reloadPlugins(plugins); - sender.sendMessage(reloadResults.toComponent(MessageKey.RELOADPLUGIN)); + reloadResults.sendTo(sender, MessageKey.RELOADPLUGIN); } protected boolean checkDependingPlugins(CommandContext context, C sender, List

plugins, String subcommand) { @@ -227,27 +224,24 @@ public abstract class CommandServerUtils pluginManager = plugin.getPluginManager(); MessagesResource messages = plugin.getMessagesResource(); - TextComponent.Builder builder = Component.text(); - boolean hasDependingPlugins = false; for (P plugin : plugins) { String pluginId = pluginManager.getPluginId(plugin); List

dependingPlugins = pluginManager.getPluginsDependingOn(pluginId); if (!dependingPlugins.isEmpty()) { + TextComponent.Builder builder = Component.text(); builder.append(messages.get(MessageKey.DEPENDING_PLUGINS_PREFIX).toComponent( Template.of("plugin", pluginId) )); - - MessagesResource.Message dependingPluginsFormat = messages.get(MessageKey.DEPENDING_PLUGINS_FORMAT); builder.append(ListComponentBuilder.create(dependingPlugins) - .format(p -> dependingPluginsFormat.toComponent( + .format(p -> messages.get(MessageKey.DEPENDING_PLUGINS_FORMAT).toComponent( Template.of("plugin", pluginManager.getPluginId(p)) )) .separator(messages.get(MessageKey.DEPENDING_PLUGINS_SEPARATOR).toComponent()) .lastSeparator(messages.get(MessageKey.DEPENDING_PLUGINS_LAST_SEPARATOR).toComponent()) .build()); - builder.append(Component.newline()); + sender.sendMessage(builder.build()); hasDependingPlugins = true; } } @@ -258,13 +252,11 @@ public abstract class CommandServerUtils void createInfo(C sender, String command, T item, InfoCreator creator) { MessagesResource messages = plugin.getMessagesResource(); - String messagePrefix = "messages." + command; - MessagesResource.Message formatMessage = messages.get(messagePrefix + ".format"); - MessagesResource.Message listFormatMessage = messages.get(messagePrefix + ".list-format"); - Component separator = messages.get(messagePrefix + ".list-separator").toComponent(); - Component lastSeparator = messages.get(messagePrefix + ".list-last-separator").toComponent(); - - TextComponent.Builder builder = Component.text() - .append(messages.get(messagePrefix + ".header").toComponent()) - .append(Component.newline()); + MessagesResource.Message formatMessage = messages.get(command + ".format"); + MessagesResource.Message listFormatMessage = messages.get(command + ".list-format"); + Component separator = messages.get(command + ".list-separator").toComponent(); + Component lastSeparator = messages.get(command + ".list-last-separator").toComponent(); + sender.sendMessage(messages.get(command + ".header").toComponent()); creator.createInfo( KeyValueComponentBuilder.create(formatMessage, "key", "value"), listBuilderConsumer -> { ListComponentBuilder listBuilder = ListComponentBuilder.create() .format(str -> listFormatMessage.toComponent(Template.of("value", str))) .separator(separator) - .lastSeparator(lastSeparator); + .lastSeparator(lastSeparator) + .emptyValue(null); listBuilderConsumer.accept(listBuilder); return listBuilder.build(); }, item - ); - - builder.append(messages.get(messagePrefix + ".footer").toComponent()); - sender.sendMessage(builder.build()); + ).build().forEach(sender::sendMessage); + sender.sendMessage(messages.get(command + ".footer").toComponent()); } private interface InfoCreator { diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResult.java b/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResult.java index 115fad1..0bfda9c 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResult.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResult.java @@ -2,7 +2,7 @@ package net.frankheijden.serverutils.common.entities.results; import net.frankheijden.serverutils.common.ServerUtilsApp; import net.frankheijden.serverutils.common.config.ConfigKey; -import net.kyori.adventure.text.Component; +import net.frankheijden.serverutils.common.entities.ServerUtilsAudience; import net.kyori.adventure.text.minimessage.Template; public class PluginResult implements AbstractResult { @@ -48,9 +48,9 @@ public class PluginResult implements AbstractResult { return plugin != null && result == Result.SUCCESS; } - public Component toComponent(ConfigKey successKey) { + public void sendTo(ServerUtilsAudience sender, ConfigKey successKey) { ConfigKey key = isSuccess() ? successKey : result.getKey(); - return ServerUtilsApp.getPlugin().getMessagesResource().get(key).toComponent(templates); + sender.sendMessage(ServerUtilsApp.getPlugin().getMessagesResource().get(key).toComponent(templates)); } @Override diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResults.java b/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResults.java index 4b04993..fb8420f 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResults.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginResults.java @@ -4,8 +4,7 @@ import java.util.ArrayList; import java.util.Iterator; import java.util.List; import net.frankheijden.serverutils.common.config.ConfigKey; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; +import net.frankheijden.serverutils.common.entities.ServerUtilsAudience; import net.kyori.adventure.text.minimessage.Template; public class PluginResults implements Iterable> { @@ -68,14 +67,12 @@ public class PluginResults implements Iterable> { } /** - * Creates a {@link Component}. + * Sends the result(s) to the given sender. */ - public Component toComponent(ConfigKey successKey) { - TextComponent.Builder builder = Component.text(); + public void sendTo(ServerUtilsAudience sender, ConfigKey successKey) { for (PluginResult result : results) { - builder.append(result.toComponent(successKey)); + result.sendTo(sender, successKey); } - return builder.build(); } @Override diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginWatchResults.java b/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginWatchResults.java index 2cb067b..60665e3 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginWatchResults.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/entities/results/PluginWatchResults.java @@ -6,8 +6,6 @@ import java.util.List; import net.frankheijden.serverutils.common.ServerUtilsApp; import net.frankheijden.serverutils.common.config.MessagesResource; import net.frankheijden.serverutils.common.entities.ServerUtilsAudience; -import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.minimessage.Template; public class PluginWatchResults implements Iterable { @@ -33,11 +31,9 @@ public class PluginWatchResults implements Iterable { public void sendTo(ServerUtilsAudience sender) { MessagesResource messages = ServerUtilsApp.getPlugin().getMessagesResource(); - TextComponent.Builder builder = Component.text(); for (PluginWatchResult watchResult : watchResults) { - builder.append(messages.get(watchResult.getKey()).toComponent(watchResult.getTemplates())); + sender.sendMessage(messages.get(watchResult.getKey()).toComponent(watchResult.getTemplates())); } - sender.sendMessage(builder.build()); } @Override diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/tasks/PluginWatcherTask.java b/Common/src/main/java/net/frankheijden/serverutils/common/tasks/PluginWatcherTask.java index 60daec1..4fa1a56 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/tasks/PluginWatcherTask.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/tasks/PluginWatcherTask.java @@ -167,7 +167,7 @@ public class PluginWatcherTask extends AbstractTask { fileNameToWatchEntryMap.clear(); PluginResults

reloadResults = pluginManager.reloadPlugins(plugins); - sender.sendMessage(reloadResults.toComponent(MessageKey.RELOADPLUGIN)); + reloadResults.sendTo(sender, MessageKey.RELOADPLUGIN); for (PluginResult

reloadResult : reloadResults) { if (!reloadResult.isSuccess()) continue; diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/utils/KeyValueComponentBuilder.java b/Common/src/main/java/net/frankheijden/serverutils/common/utils/KeyValueComponentBuilder.java index 96c055b..b2e0db3 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/utils/KeyValueComponentBuilder.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/utils/KeyValueComponentBuilder.java @@ -4,7 +4,6 @@ import java.util.ArrayList; import java.util.List; import net.frankheijden.serverutils.common.config.MessagesResource; import net.kyori.adventure.text.Component; -import net.kyori.adventure.text.TextComponent; import net.kyori.adventure.text.minimessage.Template; public class KeyValueComponentBuilder { @@ -36,60 +35,52 @@ public class KeyValueComponentBuilder { return new KeyValueComponentBuilder(format, keyPlaceholder, valuePlaceholder); } - /** - * Adds an entry. - */ - public KeyValueComponentBuilder add(String key, String value) { - if (value != null) this.templatesList.add(new Template[]{ - Template.of(keyPlaceholder, key), - Template.of(valuePlaceholder, value) - }); - return this; + public KeyValueComponentBuilder.KeyValuePair key(String key) { + return new KeyValuePair(key); } - /** - * Adds an entry. - */ - public KeyValueComponentBuilder add(String key, Component value) { - if (value != null) this.templatesList.add(new Template[]{ - Template.of(keyPlaceholder, key), - Template.of(valuePlaceholder, value) - }); - return this; + public KeyValueComponentBuilder.KeyValuePair key(Component key) { + return new KeyValuePair(key); } - /** - * Adds an entry. - */ - public KeyValueComponentBuilder add(Component key, String value) { - if (value != null) this.templatesList.add(new Template[]{ - Template.of(keyPlaceholder, key), - Template.of(valuePlaceholder, value) - }); - return this; - } - - /** - * Adds an entry. - */ - public KeyValueComponentBuilder add(Component key, Component value) { - if (value != null) this.templatesList.add(new Template[]{ - Template.of(keyPlaceholder, key), - Template.of(valuePlaceholder, value) - }); + private KeyValueComponentBuilder add(Template key, Template value) { + this.templatesList.add(new Template[]{ key, value }); return this; } /** * Builds the current ListMessageBuilder instance into a Component. */ - public Component build() { - TextComponent.Builder builder = Component.text(); + public List build() { + List components = new ArrayList<>(templatesList.size()); for (Template[] templates : templatesList) { - builder.append(format.toComponent(templates)); + components.add(format.toComponent(templates)); } - return builder.build(); + return components; + } + + public class KeyValuePair { + + private final Template key; + + private KeyValuePair(String key) { + this.key = Template.of(keyPlaceholder, key); + } + + private KeyValuePair(Component key) { + this.key = Template.of(keyPlaceholder, key); + } + + public KeyValueComponentBuilder value(String value) { + if (value == null) return KeyValueComponentBuilder.this; + return add(key, Template.of(valuePlaceholder, value)); + } + + public KeyValueComponentBuilder value(Component value) { + if (value == null) return KeyValueComponentBuilder.this; + return add(key, Template.of(valuePlaceholder, value)); + } } } diff --git a/Common/src/main/java/net/frankheijden/serverutils/common/utils/ListComponentBuilder.java b/Common/src/main/java/net/frankheijden/serverutils/common/utils/ListComponentBuilder.java index 474c3e7..6607ee4 100644 --- a/Common/src/main/java/net/frankheijden/serverutils/common/utils/ListComponentBuilder.java +++ b/Common/src/main/java/net/frankheijden/serverutils/common/utils/ListComponentBuilder.java @@ -13,9 +13,11 @@ public class ListComponentBuilder { private Format format; private Component separator; private Component lastSeparator; + private Component emptyValue; private ListComponentBuilder() { this.elements = new ArrayList<>(); + this.emptyValue = Component.empty(); } public static ListComponentBuilder create(Collection list) { @@ -42,6 +44,11 @@ public class ListComponentBuilder { return this; } + public ListComponentBuilder emptyValue(Component emptyValue) { + this.emptyValue = emptyValue; + return this; + } + public ListComponentBuilder addAll(Collection elements) { this.elements.addAll(elements); return this; @@ -51,10 +58,12 @@ public class ListComponentBuilder { * Builds the ListComponent. */ public Component build() { - if (elements.size() == 1) { + if (elements.isEmpty()) { + return emptyValue; + } else if (elements.size() == 1) { return format.format(elements.iterator().next()); } else { - TextComponent.Builder builder = Component.empty().toBuilder(); + TextComponent.Builder builder = Component.text(); int sizeMinusTwo = elements.size() - 2; for (int i = 0; i < elements.size(); i++) { diff --git a/Velocity/src/main/java/net/frankheijden/serverutils/velocity/commands/VelocityCommandServerUtils.java b/Velocity/src/main/java/net/frankheijden/serverutils/velocity/commands/VelocityCommandServerUtils.java index 06f4b85..5f5f620 100644 --- a/Velocity/src/main/java/net/frankheijden/serverutils/velocity/commands/VelocityCommandServerUtils.java +++ b/Velocity/src/main/java/net/frankheijden/serverutils/velocity/commands/VelocityCommandServerUtils.java @@ -33,22 +33,18 @@ public class VelocityCommandServerUtils extends CommandServerUtils")) - .add( - "Author" + (desc.getAuthors().size() == 1 ? "" : "s"), - listBuilderFunction.apply(b -> b.addAll(desc.getAuthors())) - ) - .add("Description", desc.getDescription().orElse(null)) - .add("URL", desc.getUrl().orElse(null)) - .add("Source", desc.getSource().map(Path::toString).orElse(null)) - .add( - "Dependencies", - listBuilderFunction.apply(b -> b.addAll(desc.getDependencies().stream() - .map(PluginDependency::getId) - .collect(Collectors.toList()))) - ); + .key("Id").value(desc.getId()) + .key("Name").value(desc.getName().orElse(null)) + .key("Version").value(desc.getVersion().orElse("")) + .key("Author" + (desc.getAuthors().size() == 1 ? "" : "s")) + .value(listBuilderFunction.apply(b -> b.addAll(desc.getAuthors()))) + .key("Description").value(desc.getDescription().orElse(null)) + .key("URL").value(desc.getUrl().orElse(null)) + .key("Source").value(desc.getSource().map(Path::toString).orElse(null)) + .key("Dependencies") + .value(listBuilderFunction.apply(b -> b.addAll(desc.getDependencies().stream() + .map(PluginDependency::getId) + .collect(Collectors.toList())))); } @Override @@ -63,7 +59,7 @@ public class VelocityCommandServerUtils extends CommandServerUtils")); + .key("Name").value(dispatcher.getRoot().getChild(commandName).getName()) + .key("Plugin").value(plugin.getPluginCommandManager().findPluginId(commandName).orElse("")); } }