aboutsummaryrefslogtreecommitdiff
path: root/spark-fabric/src/main
diff options
context:
space:
mode:
authorLuck <git@lucko.me>2022-04-24 17:25:47 +0100
committerLuck <git@lucko.me>2022-04-24 17:25:47 +0100
commitb077100667c1dee6e73da399e3484f92bbf67cb8 (patch)
treeefac3cb29cb4cdbb93ba7ab2ba2aac9b050731f2 /spark-fabric/src/main
parentda5a859adb7d25752dd0d3564fa15669242ae92f (diff)
downloadspark-b077100667c1dee6e73da399e3484f92bbf67cb8.tar.gz
spark-b077100667c1dee6e73da399e3484f92bbf67cb8.tar.bz2
spark-b077100667c1dee6e73da399e3484f92bbf67cb8.zip
Fix NPE caused by initialisation order on Forge/Fabric
Diffstat (limited to 'spark-fabric/src/main')
-rw-r--r--spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java5
1 files changed, 3 insertions, 2 deletions
diff --git a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java
index 7b0af11..7d0a989 100644
--- a/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java
+++ b/spark-fabric/src/main/java/me/lucko/spark/fabric/plugin/FabricSparkPlugin.java
@@ -55,17 +55,18 @@ public abstract class FabricSparkPlugin implements SparkPlugin {
private final FabricSparkMod mod;
private final Logger logger;
protected final ScheduledExecutorService scheduler;
- protected final SparkPlatform platform;
+
+ protected SparkPlatform platform;
protected final ThreadDumper.GameThread threadDumper = new ThreadDumper.GameThread();
protected FabricSparkPlugin(FabricSparkMod mod) {
this.mod = mod;
this.logger = LogManager.getLogger("spark");
this.scheduler = Executors.newScheduledThreadPool(4, new SparkThreadFactory());
- this.platform = new SparkPlatform(this);
}
public void enable() {
+ this.platform = new SparkPlatform(this);
this.platform.enable();
}