aboutsummaryrefslogtreecommitdiff
path: root/spark-sponge/src
diff options
context:
space:
mode:
Diffstat (limited to 'spark-sponge/src')
-rw-r--r--spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java4
1 files changed, 3 insertions, 1 deletions
diff --git a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java
index 9437207..dbd0193 100644
--- a/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java
+++ b/spark-sponge/src/main/java/me/lucko/spark/sponge/SpongeSparkPlugin.java
@@ -74,6 +74,7 @@ public class SpongeSparkPlugin implements SparkPlugin {
private SpongeAudiences audienceFactory;
private SparkPlatform platform;
+ private final ThreadDumper.GameThread threadDumper = new ThreadDumper.GameThread();
@Inject
public SpongeSparkPlugin(PluginContainer pluginContainer, Game game, @ConfigDir(sharedRoot = false) Path configDirectory, @AsynchronousExecutor SpongeExecutorService asyncExecutor) {
@@ -126,7 +127,7 @@ public class SpongeSparkPlugin implements SparkPlugin {
@Override
public ThreadDumper getDefaultThreadDumper() {
- return new ThreadDumper.Specific(new long[]{Thread.currentThread().getId()});
+ return this.threadDumper.get();
}
@Override
@@ -148,6 +149,7 @@ public class SpongeSparkPlugin implements SparkPlugin {
@Override
public CommandResult process(CommandSource source, String arguments) {
+ this.plugin.threadDumper.ensureSetup();
this.plugin.platform.executeCommand(new SpongeCommandSender(source, this.plugin.audienceFactory), arguments.split(" "));
return CommandResult.empty();
}