Improve list display in PluginInfo
This commit is contained in:
parent
4419dc6d7f
commit
d71087c3d8
2 changed files with 14 additions and 5 deletions
|
|
@ -149,9 +149,12 @@ public class CommandServerUtils extends BaseCommand {
|
||||||
|
|
||||||
PluginDescriptionFile description = plugin.getDescription();
|
PluginDescriptionFile description = plugin.getDescription();
|
||||||
String format = Messenger.getMessage("serverutils.plugininfo.format");
|
String format = Messenger.getMessage("serverutils.plugininfo.format");
|
||||||
|
String listFormatString = Messenger.getMessage("serverutils.plugininfo.list_format");
|
||||||
String seperator = Messenger.getMessage("serverutils.plugininfo.seperator");
|
String seperator = Messenger.getMessage("serverutils.plugininfo.seperator");
|
||||||
String lastSeperator = Messenger.getMessage("serverutils.plugininfo.last_seperator");
|
String lastSeperator = Messenger.getMessage("serverutils.plugininfo.last_seperator");
|
||||||
|
|
||||||
|
ListFormat<String> listFormat = str -> listFormatString.replace("%value%", str);
|
||||||
|
|
||||||
Messenger.sendMessage(sender, "serverutils.plugininfo.header");
|
Messenger.sendMessage(sender, "serverutils.plugininfo.header");
|
||||||
|
|
||||||
FormatBuilder builder = FormatBuilder.create(format)
|
FormatBuilder builder = FormatBuilder.create(format)
|
||||||
|
|
@ -161,7 +164,8 @@ public class CommandServerUtils extends BaseCommand {
|
||||||
.add("Version", description.getVersion());
|
.add("Version", description.getVersion());
|
||||||
if (MINOR >= 13) builder.add( "API Version", description.getAPIVersion());
|
if (MINOR >= 13) builder.add( "API Version", description.getAPIVersion());
|
||||||
builder.add("Website", description.getWebsite())
|
builder.add("Website", description.getWebsite())
|
||||||
.add("Authors", ListBuilder.createStrings(description.getAuthors())
|
.add("Authors", ListBuilder.create(description.getAuthors())
|
||||||
|
.format(listFormat)
|
||||||
.seperator(seperator)
|
.seperator(seperator)
|
||||||
.lastSeperator(lastSeperator)
|
.lastSeperator(lastSeperator)
|
||||||
.toString())
|
.toString())
|
||||||
|
|
@ -169,19 +173,23 @@ public class CommandServerUtils extends BaseCommand {
|
||||||
.add("Main", description.getMain())
|
.add("Main", description.getMain())
|
||||||
.add("Prefix", description.getPrefix())
|
.add("Prefix", description.getPrefix())
|
||||||
.add("Load Order", description.getLoad().name())
|
.add("Load Order", description.getLoad().name())
|
||||||
.add("Load Before", ListBuilder.createStrings(description.getLoadBefore())
|
.add("Load Before", ListBuilder.create(description.getLoadBefore())
|
||||||
|
.format(listFormat)
|
||||||
.seperator(seperator)
|
.seperator(seperator)
|
||||||
.lastSeperator(lastSeperator)
|
.lastSeperator(lastSeperator)
|
||||||
.toString())
|
.toString())
|
||||||
.add("Depend", ListBuilder.createStrings(description.getDepend())
|
.add("Depend", ListBuilder.create(description.getDepend())
|
||||||
|
.format(listFormat)
|
||||||
.seperator(seperator)
|
.seperator(seperator)
|
||||||
.lastSeperator(lastSeperator)
|
.lastSeperator(lastSeperator)
|
||||||
.toString())
|
.toString())
|
||||||
.add("Soft Depend", ListBuilder.createStrings(description.getSoftDepend())
|
.add("Soft Depend", ListBuilder.create(description.getSoftDepend())
|
||||||
|
.format(listFormat)
|
||||||
.seperator(seperator)
|
.seperator(seperator)
|
||||||
.lastSeperator(lastSeperator)
|
.lastSeperator(lastSeperator)
|
||||||
.toString());
|
.toString());
|
||||||
if (MINOR >= 15) builder.add("Provides", ListBuilder.createStrings(description.getProvides())
|
if (MINOR >= 15) builder.add("Provides", ListBuilder.create(description.getProvides())
|
||||||
|
.format(listFormat)
|
||||||
.seperator(seperator)
|
.seperator(seperator)
|
||||||
.lastSeperator(lastSeperator)
|
.lastSeperator(lastSeperator)
|
||||||
.toString());
|
.toString());
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ public class Messenger {
|
||||||
"plugininfo", Defaults.of(
|
"plugininfo", Defaults.of(
|
||||||
"header", "&8&m-----------=&r&8[ &b&lServerUtils PluginInfo&r &8]&m=-----------",
|
"header", "&8&m-----------=&r&8[ &b&lServerUtils PluginInfo&r &8]&m=-----------",
|
||||||
"format", " &3%key%&8: &b%value%",
|
"format", " &3%key%&8: &b%value%",
|
||||||
|
"list_format", "&b%value%",
|
||||||
"seperator", "&8, ",
|
"seperator", "&8, ",
|
||||||
"last_seperator", " &8and ",
|
"last_seperator", " &8and ",
|
||||||
"footer", "&8&m-------------------------------------------------"
|
"footer", "&8&m-------------------------------------------------"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue