diff options
author | Luck <git@lucko.me> | 2022-07-12 22:37:59 +0100 |
---|---|---|
committer | Luck <git@lucko.me> | 2022-07-12 22:37:59 +0100 |
commit | 73dd214ae66bab483ee8b4f0ed03881466da92e8 (patch) | |
tree | 11b433c6b9b15e75249732248c150c35af08c24f /spark-bukkit | |
parent | a10f966a443d56845a5efb1e65232e6b87eabb96 (diff) | |
download | spark-73dd214ae66bab483ee8b4f0ed03881466da92e8.tar.gz spark-73dd214ae66bab483ee8b4f0ed03881466da92e8.tar.bz2 spark-73dd214ae66bab483ee8b4f0ed03881466da92e8.zip |
Improve/fix game thread dumper
Diffstat (limited to 'spark-bukkit')
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitSparkPlugin.java | 7 | ||||
-rw-r--r-- | spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java | 1 |
2 files changed, 4 insertions, 4 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 fddd66b..5737d3d 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 @@ -50,14 +50,16 @@ import java.util.stream.Stream; public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin { private BukkitAudiences audienceFactory; + private ThreadDumper gameThreadDumper; + private SparkPlatform platform; private CommandExecutor tpsCommand = null; - private final ThreadDumper.GameThread threadDumper = new ThreadDumper.GameThread(); @Override public void onEnable() { this.audienceFactory = BukkitAudiences.create(this); + this.gameThreadDumper = new ThreadDumper.Specific(Thread.currentThread()); this.platform = new SparkPlatform(this); this.platform.enable(); @@ -102,7 +104,6 @@ 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; } @@ -152,7 +153,7 @@ public class BukkitSparkPlugin extends JavaPlugin implements SparkPlugin { @Override public ThreadDumper getDefaultThreadDumper() { - return this.threadDumper.get(); + return this.gameThreadDumper; } @Override diff --git a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java index f34899b..5d50eeb 100644 --- a/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java +++ b/spark-bukkit/src/main/java/me/lucko/spark/bukkit/BukkitWorldInfoProvider.java @@ -31,7 +31,6 @@ import org.bukkit.entity.Entity; import org.bukkit.entity.EntityType; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; public class BukkitWorldInfoProvider implements WorldInfoProvider { |