mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI.git
synced 2024-12-27 11:27:40 +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());
|
||||
|
||||
int size = 0;
|
||||
|
||||
for (final String name : expansions.stream().map(PlaceholderExpansion::getIdentifier)
|
||||
.collect(Collectors.toList())) {
|
||||
if (name.length() > size) {
|
||||
size = name.length();
|
||||
}
|
||||
}
|
||||
int size = expansions.stream().map(e -> e.getIdentifier().length())
|
||||
.max(Integer::compareTo)
|
||||
.orElse(0);
|
||||
|
||||
for (final PlaceholderExpansion expansion : expansions) {
|
||||
builder.append(" ")
|
||||
@ -198,12 +193,9 @@ public final class CommandDump extends PlaceholderCommand {
|
||||
.sorted(Comparator.comparing(Plugin::getName))
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (final String pluginName : plugins.stream().map(Plugin::getName)
|
||||
.collect(Collectors.toList())) {
|
||||
if (pluginName.length() > size) {
|
||||
size = pluginName.length();
|
||||
}
|
||||
}
|
||||
size = plugins.stream().map(pl -> pl.getName().length())
|
||||
.max(Integer::compareTo)
|
||||
.orElse(0);
|
||||
|
||||
for (final Plugin other : plugins) {
|
||||
builder.append(" ")
|
||||
|
Loading…
Reference in New Issue
Block a user