From a3129bc834bf22b89f7ac545a960b89361b03459 Mon Sep 17 00:00:00 2001 From: Luck Date: Sat, 27 Mar 2021 18:51:20 +0000 Subject: Execute commands async --- .../src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'spark-bukkit/src/main/java/me/lucko/spark') 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 -- cgit