diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-17 17:07:49 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-11-17 17:07:49 +0800 |
commit | f9085b19e0bc3d4bc28fc13a5603a31a91ee7c20 (patch) | |
tree | ddc15e284c7e800bef0321ac5c7f0a028f56409b /featureClass/featureManager.js | |
parent | 84c0f2e026ebfa9017dacc1f8bfde9647315392a (diff) | |
download | SoopyV2-f9085b19e0bc3d4bc28fc13a5603a31a91ee7c20.tar.gz SoopyV2-f9085b19e0bc3d4bc28fc13a5603a31a91ee7c20.tar.bz2 SoopyV2-f9085b19e0bc3d4bc28fc13a5603a31a91ee7c20.zip |
- unload all modules on game unload event
- make all chatlib chats use soopyv2 prefix
Diffstat (limited to 'featureClass/featureManager.js')
-rw-r--r-- | featureClass/featureManager.js | 9 |
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] } |