use of org.spongepowered.plugin.metadata.PluginMetadata in project SpongeCommon by SpongePowered.
the class SpongeCommand method pluginsListSubcommand.
@NonNull
private CommandResult pluginsListSubcommand(final CommandContext context) {
final Collection<PluginContainer> plugins = Launch.instance().pluginManager().plugins();
context.sendMessage(Identity.nil(), this.title("Plugins (" + plugins.size() + ")"));
for (final PluginContainer specificContainer : plugins) {
final PluginMetadata metadata = specificContainer.metadata();
final TextComponent.Builder builder = Component.text();
this.createShortContainerMeta(builder.append(SpongeCommand.INDENT_COMPONENT), metadata);
builder.clickEvent(SpongeComponents.executeCallback(cause -> cause.sendMessage(Identity.nil(), this.createContainerMeta(metadata))));
context.sendMessage(Identity.nil(), builder.build());
}
return CommandResult.success();
}
Aggregations