From f9085b19e0bc3d4bc28fc13a5603a31a91ee7c20 Mon Sep 17 00:00:00 2001
From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com>
Date: Wed, 17 Nov 2021 17:07:49 +0800
Subject: - unload all modules on game unload event - make all chatlib chats
use soopyv2 prefix
---
featureClass/featureManager.js | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
(limited to 'featureClass/featureManager.js')
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js
index 5287a6f..0d9101b 100644
--- a/featureClass/featureManager.js
+++ b/featureClass/featureManager.js
@@ -1,11 +1,9 @@
///
///
-import LocationSetting from "../features/settings/settingThings/location";
import logger from "../logger";
const File = Java.type("java.io.File")
import metadata from "../metadata.js"
import { registerForge as registerForgeBase, unregisterForge as unregisterForgeBase} from "./forgeEvents.js"
-import soopyV2Server from "../socketConnection"
class FeatureManager {
constructor(){
@@ -60,6 +58,7 @@ class FeatureManager {
this.registerEvent("worldUnload", this.saveFeatureSettings, this)
this.registerEvent("gameUnload", this.saveFeatureSettings, this)
+ this.registerEvent("gameUnload", this.unloadAllFeatures, this)
this.registerCommand("soopyunloadfeature", (args)=>{
new Thread(()=>{
@@ -376,6 +375,12 @@ class FeatureManager {
return this
}
+ unloadAllFeatures(){
+ Object.keys(this.features).forEach((feature)=>{
+ this.unloadFeature(feature)
+ })
+ }
+
isFeatureLoaded(feature){
return !!this.features[feature]
}
--
cgit