Search in sources :

Example 1 with PluginContributor

use of org.spongepowered.plugin.metadata.model.PluginContributor in project SpongeCommon by SpongePowered.

the class SpongeCommand method createContainerMeta.

private Component createContainerMeta(final PluginMetadata pluginMetadata) {
    final TextComponent.Builder builder = Component.text();
    this.createShortContainerMeta(builder, pluginMetadata);
    this.appendPluginMeta(builder, "ID", pluginMetadata.id());
    pluginMetadata.description().ifPresent(x -> this.appendPluginMeta(builder, "Description", x));
    pluginMetadata.links().homepage().ifPresent(x -> this.appendPluginMeta(builder, "Homepage", x));
    pluginMetadata.links().issues().ifPresent(x -> this.appendPluginMeta(builder, "Issues", x));
    pluginMetadata.links().source().ifPresent(x -> this.appendPluginMeta(builder, "Source", x));
    final Collection<PluginContributor> contributors = pluginMetadata.contributors();
    if (!contributors.isEmpty()) {
        builder.append(Component.newline()).append(SpongeCommand.INDENT_COMPONENT).append(this.title("Contributors:"));
        for (final PluginContributor contributor : contributors) {
            builder.append(Component.newline()).append(SpongeCommand.LONG_INDENT_COMPONENT).append(Component.text(contributor.name()));
            contributor.description().ifPresent(x -> builder.append(Component.text(" (" + x + ")")));
        }
    }
    this.appendPluginMeta(builder, "Entrypoint", pluginMetadata.entrypoint());
    return builder.build();
}
Also used : TextComponent(net.kyori.adventure.text.TextComponent) PluginContributor(org.spongepowered.plugin.metadata.model.PluginContributor)

Aggregations

TextComponent (net.kyori.adventure.text.TextComponent)1 PluginContributor (org.spongepowered.plugin.metadata.model.PluginContributor)1