mirror of
https://github.com/PlaceholderAPI/PlaceholderAPI
synced 2024-11-18 00:46:55 +01:00
Improve expansion sorting in /papi dump
This commit is contained in:
parent
666ab468a1
commit
631609af74
@ -106,7 +106,6 @@ public final class CommandDump extends PlaceholderCommand {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try (final InputStream stream = connection.getInputStream()) {
|
try (final InputStream stream = connection.getInputStream()) {
|
||||||
//noinspection UnstableApiUsage
|
|
||||||
final String json = CharStreams.toString(new InputStreamReader(stream, StandardCharsets.UTF_8));
|
final String json = CharStreams.toString(new InputStreamReader(stream, StandardCharsets.UTF_8));
|
||||||
return gson.fromJson(json, JsonObject.class).get("key").getAsString();
|
return gson.fromJson(json, JsonObject.class).get("key").getAsString();
|
||||||
}
|
}
|
||||||
@ -134,8 +133,10 @@ public final class CommandDump extends PlaceholderCommand {
|
|||||||
final List<PlaceholderExpansion> expansions = plugin.getLocalExpansionManager()
|
final List<PlaceholderExpansion> expansions = plugin.getLocalExpansionManager()
|
||||||
.getExpansions()
|
.getExpansions()
|
||||||
.stream()
|
.stream()
|
||||||
.sorted(Comparator.comparing(PlaceholderExpansion::getIdentifier))
|
.sorted(
|
||||||
.sorted(Comparator.comparing(PlaceholderExpansion::getAuthor))
|
Comparator.comparing(PlaceholderExpansion::getIdentifier)
|
||||||
|
.thenComparing(PlaceholderExpansion::getAuthor)
|
||||||
|
)
|
||||||
.collect(Collectors.toList());
|
.collect(Collectors.toList());
|
||||||
|
|
||||||
int size = 0;
|
int size = 0;
|
||||||
@ -167,11 +168,16 @@ public final class CommandDump extends PlaceholderCommand {
|
|||||||
.getExpansionsFolder()
|
.getExpansionsFolder()
|
||||||
.list((dir, name) -> name.toLowerCase().endsWith(".jar"));
|
.list((dir, name) -> name.toLowerCase().endsWith(".jar"));
|
||||||
|
|
||||||
|
|
||||||
|
if (jars == null) {
|
||||||
|
builder.append(" WARN: Jars array was empty!");
|
||||||
|
} else {
|
||||||
for (final String jar : jars) {
|
for (final String jar : jars) {
|
||||||
builder.append(" ")
|
builder.append(" ")
|
||||||
.append(jar)
|
.append(jar)
|
||||||
.append('\n');
|
.append('\n');
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
builder.append('\n');
|
builder.append('\n');
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user