aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--featureClass/featureManager.js14
-rw-r--r--features/specialMining/index.js8
2 files changed, 19 insertions, 3 deletions
diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js
index 75ffa48..4aae70f 100644
--- a/featureClass/featureManager.js
+++ b/featureClass/featureManager.js
@@ -748,18 +748,30 @@ class FeatureManager {
loadSoopy() {
ChatLib.chat(this.messagePrefix + "Loading SoopyV2...")
+ let startLoading = Date.now()
this.loadFeatureMetas()
this.loadFeatureSettings()
+ let loadedFeatures = new Map()
+
Object.keys(this.featureMetas).forEach((feature) => {
if (this.featureSettingsData[feature] && this.featureSettingsData[feature].enabled) {
- this.loadFeature(feature)
+ loadedFeatures.set(feature, false)
+ new Thread(() => {
+ this.loadFeature(feature)
+ loadedFeatures.set(feature, true)
+ }).start()
}
})
+ while ([...loadedFeatures.values()].some(a => !a)) {
+ Thread.sleep(100)
+ }
+
this.finishedLoading = true
ChatLib.chat(this.messagePrefix + "SoopyV2 Loaded!")
+ logger.logMessage("SoopyV2 took " + ((Date.now() - startLoading) / 1000).toFixed(2) + "s to load", 3)
}
loadFeature(feature) { //run in seperate thread so onenable can do network requests
diff --git a/features/specialMining/index.js b/features/specialMining/index.js
index 0da808d..c7929fb 100644
--- a/features/specialMining/index.js
+++ b/features/specialMining/index.js
@@ -423,8 +423,12 @@ class PowderAndScatha extends Feature {
} else if (this.wormEntity) {
this.wormEntity = undefined;
}
- tempText = this.wormEntity.getName()
- this.scathaHealthElement.setText(tempText)
+ if (this.wormEntity) {
+ tempText = this.wormEntity.getName()
+ this.scathaHealthElement.setText(tempText)
+ } else {
+ this.scathaHealthElement.setText("")
+ }
}
initVariables() {