aboutsummaryrefslogtreecommitdiff
path: root/spark-bukkit/src/main
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2021-03-27 18:51:20 +0000
committerLuck <git@lucko.me>2021-03-27 18:51:31 +0000
commita3129bc834bf22b89f7ac545a960b89361b03459 (patch)
treeded73116fb2e775b24f229b01e891194b41d24b3 /spark-bukkit/src/main
parentda2b2e3d948e7533379f039a6686d2b5e3722047 (diff)
downloadspark-a3129bc834bf22b89f7ac545a960b89361b03459.tar.gz
spark-a3129bc834bf22b89f7ac545a960b89361b03459.tar.bz2
spark-a3129bc834bf22b89f7ac545a960b89361b03459.zip
Execute commands async
Diffstat (limited to 'spark-bukkit/src/main')
-rw-r--r--spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java
index 53a9a7d..77fa64c 100644
--- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java
+++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java
@@ -46,6 +46,7 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin {
private SparkPlatform platform;
private CommandExecutor tpsCommand = null;
+ private final ThreadDumper.GameThread threadDumper = new ThreadDumper.GameThread();
@Override
public void onEnable() {
@@ -94,6 +95,7 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin {
@Override
public boolean onCommand(CommandSender sender, Command command, String label, String[] args) {
+ this.threadDumper.ensureSetup();
this.platform.executeCommand(new BukkitCommandSender(sender, this.audienceFactory), args);
return true;
}
@@ -133,7 +135,7 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin {
@Override
public ThreadDumper getDefaultThreadDumper() {
- return new ThreadDumper.Specific(new long[]{Thread.currentThread().getId()});
+ return this.threadDumper.get();
}
@Override