aboutsummaryrefslogtreecommitdiff
path: root/spark-bukkit
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2019-05-13 12:51:54 +0100
committerLuck <git@lucko.me>2019-05-13 12:51:54 +0100
commitb1bdc139b48517a8bcc88888147f5f1a65b48f93 (patch)
treeeb6aaa3bc5ba38ed39d3ec4b4d943bff38a19f66 /spark-bukkit
parent6602483b18ff556147094c2e6b816b0898ed698e (diff)
downloadspark-b1bdc139b48517a8bcc88888147f5f1a65b48f93.tar.gz
spark-b1bdc139b48517a8bcc88888147f5f1a65b48f93.tar.bz2
spark-b1bdc139b48517a8bcc88888147f5f1a65b48f93.zip
Change the way CPU monitoring is performed
Diffstat (limited to 'spark-bukkit')
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java
index 6d0d96e..ad6fa56 100644
--- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/SparkBukkitPlugin.java
@@ -23,11 +23,8 @@ package me.lucko.spark.bukkit;
import me.lucko.spark.common.CommandSender;
import me.lucko.spark.common.SparkPlatform;
import me.lucko.spark.common.SparkPlugin;
-import me.lucko.spark.common.command.CommandResponseHandler;
-import me.lucko.spark.common.monitor.tick.TpsCalculator;
import me.lucko.spark.common.sampler.ThreadDumper;
import me.lucko.spark.common.sampler.TickCounter;
-import net.kyori.text.TextComponent;
import org.bukkit.ChatColor;
import org.bukkit.command.Command;
import org.bukkit.command.CommandExecutor;
@@ -56,10 +53,13 @@ public class SparkBukkitPlugin extends JavaPlugin implements SparkPlugin {
return true;
}
- CommandResponseHandler resp = new CommandResponseHandler(this.platform, new BukkitCommandSender(sender));
- TpsCalculator tpsCalculator = this.platform.getTpsCalculator();
- resp.replyPrefixed(TextComponent.of("TPS from last 5s, 10s, 1m, 5m, 15m:"));
- resp.replyPrefixed(TextComponent.builder(" ").append(tpsCalculator.toFormattedComponent()).build());
+ BukkitCommandSender s = new BukkitCommandSender(sender) {
+ @Override
+ public boolean hasPermission(String permission) {
+ return true;
+ }
+ };
+ this.platform.executeCommand(s, new String[]{"tps"});
return true;
};
CommandMapUtil.registerCommand(this, this.tpsCommand, "tps");