aboutsummaryrefslogtreecommitdiff
path: root/spark-common/src/main/java/me/lucko/spark/common
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-06-18 15:05:57 +0100
committerLuck <git@lucko.me>2019-06-18 15:05:57 +0100
commit3b4f13ef58f6ced285876900e1ba5c898dfac858 (patch)
tree044357cc140ec38c761fd55df52f7e914ffe2813 /spark-common/src/main/java/me/lucko/spark/common
parent7c614e33f5c050a4e6f83cfbc7b7bd259700778a (diff)
downloadspark-3b4f13ef58f6ced285876900e1ba5c898dfac858.tar.gz
spark-3b4f13ef58f6ced285876900e1ba5c898dfac858.tar.bz2
spark-3b4f13ef58f6ced285876900e1ba5c898dfac858.zip
Send separate messages instead of using newline (#17)
Diffstat (limited to 'spark-common/src/main/java/me/lucko/spark/common')
-rw-r--r--spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java8
1 files changed, 3 insertions, 5 deletions
diff --git a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java
index 7ad9525..963ffcd 100644
--- a/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java
+++ b/spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java
@@ -41,7 +41,7 @@ import java.lang.management.MemoryUsage;
import java.nio.file.FileStore;
import java.nio.file.Files;
import java.nio.file.Paths;
-import java.util.ArrayList;
+import java.util.LinkedList;
import java.util.List;
import java.util.function.Consumer;
@@ -92,7 +92,7 @@ public class HealthModule implements CommandModule {
.executor((platform, sender, resp, arguments) -> {
resp.replyPrefixed(TextComponent.of("Generating server health report..."));
platform.getPlugin().runAsync(() -> {
- List<Component> report = new ArrayList<>(15);
+ List<Component> report = new LinkedList<>();
report.add(TextComponent.empty());
TpsCalculator tpsCalculator = platform.getTpsCalculator();
@@ -248,9 +248,7 @@ public class HealthModule implements CommandModule {
e.printStackTrace();
}
- TextComponent.Builder builder = TextComponent.builder("");
- report.forEach(line -> builder.append(line).append(TextComponent.newline()));
- resp.reply(builder.build());
+ report.forEach(resp::reply);
});
})
.tabCompleter((platform, sender, arguments) -> TabCompleter.completeForOpts(arguments, "--memory"))