diff options
author | Luck <git@lucko.me> | 2019-05-13 13:00:05 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2019-05-13 13:00:05 +0100 |
commit | 7e20d1595a0665f4518d863230b4f8136f41e210 (patch) | |
tree | b0cd67eecfd4caebe58d2d2aac576f785c98c752 /spark-common/src/main | |
parent | 4f1fa802c75efb6689c8d5cf1aef954eca7d1d0a (diff) | |
download | spark-7e20d1595a0665f4518d863230b4f8136f41e210.tar.gz spark-7e20d1595a0665f4518d863230b4f8136f41e210.tar.bz2 spark-7e20d1595a0665f4518d863230b4f8136f41e210.zip |
Combine tps and cpu commands into one
Diffstat (limited to 'spark-common/src/main')
-rw-r--r-- | spark-common/src/main/java/me/lucko/spark/common/command/modules/HealthModule.java | 12 |
1 files changed, 2 insertions, 10 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 9c139eb..921495c 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 @@ -49,7 +49,7 @@ public class HealthModule implements CommandModule { @Override public void registerCommands(Consumer<Command> consumer) { consumer.accept(Command.builder() - .aliases("tps") + .aliases("tps", "cpu") .executor((platform, sender, resp, arguments) -> { TpsCalculator tpsCalculator = platform.getTpsCalculator(); if (tpsCalculator != null) { @@ -62,17 +62,9 @@ public class HealthModule implements CommandModule { .append(formatTps(tpsCalculator.avg15Min())) .build() ); - } else { - resp.replyPrefixed(TextComponent.of("Not supported!")); + resp.replyPrefixed(TextComponent.empty()); } - }) - .tabCompleter(Command.TabCompleter.empty()) - .build() - ); - consumer.accept(Command.builder() - .aliases("cpu") - .executor((platform, sender, resp, arguments) -> { resp.replyPrefixed(TextComponent.of("CPU usage from last 10s, 1m, 15m:")); resp.replyPrefixed(TextComponent.builder(" ") .append(formatCpuUsage(CpuMonitor.systemLoad10SecAvg())).append(TextComponent.of(", ")) |