mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Use stream to get size padding
This commit is contained in:
parent
0e0e36476a
commit
0be6b721cf
@ -139,14 +139,9 @@ public final class CommandDump extends PlaceholderCommand {
|
|||||||
)
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
int size = 0;
|
int size = expansions.stream().map(e -> e.getIdentifier().length())
|
||||||
|
.max(Integer::compareTo)
|
||||||
for (final String name : expansions.stream().map(PlaceholderExpansion::getIdentifier)
|
.orElse(0);
|
||||||
.collect(Collectors.toList())) {
|
|
||||||
if (name.length() > size) {
|
|
||||||
size = name.length();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (final PlaceholderExpansion expansion : expansions) {
|
for (final PlaceholderExpansion expansion : expansions) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
@ -198,12 +193,9 @@ public final class CommandDump extends PlaceholderCommand {
|
|||||||
.sorted(Comparator.comparing(Plugin::getName))
|
.sorted(Comparator.comparing(Plugin::getName))
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
for (final String pluginName : plugins.stream().map(Plugin::getName)
|
size = plugins.stream().map(pl -> pl.getName().length())
|
||||||
.collect(Collectors.toList())) {
|
.max(Integer::compareTo)
|
||||||
if (pluginName.length() > size) {
|
.orElse(0);
|
||||||
size = pluginName.length();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
for (final Plugin other : plugins) {
|
for (final Plugin other : plugins) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
|
Loading…
Reference in New Issue
Block a user