aboutsummaryrefslogtreecommitdiff
path: root/featureClass/featureManager.js
diff options
context:
space:
mode:
Diffstat (limited to 'featureClass/featureManager.js')
-rw-r--r--featureClass/featureManager.js9
1 files changed, 7 insertions, 2 deletions
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 @@
/// <reference types="../../CTAutocomplete" />
/// <reference lib="es2015" />
-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]
}