aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorembeddedt <42941056+embeddedt@users.noreply.github.com>2023-05-24 12:27:38 -0400
committerembeddedt <42941056+embeddedt@users.noreply.github.com>2023-05-24 12:27:38 -0400
commita89e8d3cc42702e80e2f973e79aab6090e74a72e (patch)
treed4f6c92ce81256dbda05a3005534e0c0f0265d9c
parent751f2c7aa49b88f41a7b5bd4b1c1bc217964dc9f (diff)
downloadspark-a89e8d3cc42702e80e2f973e79aab6090e74a72e.tar.gz
spark-a89e8d3cc42702e80e2f973e79aab6090e74a72e.tar.bz2
spark-a89e8d3cc42702e80e2f973e79aab6090e74a72e.zip
Make sure the server plugin unregisters itself when disabled
-rw-r--r--spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java b/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java
index 059b684..03f55d7 100644
--- a/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java
+++ b/spark-forge1710/src/main/java/me/lucko/spark/forge/plugin/Forge1710ServerSparkPlugin.java
@@ -57,6 +57,12 @@ public class Forge1710ServerSparkPlugin extends Forge1710SparkPlugin {
return plugin;
}
+ @Override
+ public void disable() {
+ super.disable();
+ FMLCommonHandler.instance().bus().unregister(this);
+ }
+
@SubscribeEvent
public void onServerTickEnd(TickEvent.ServerTickEvent event) {
if(event.phase == TickEvent.Phase.START) {