aboutsummaryrefslogtreecommitdiff
path: root/features/dataLoader/index.js
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-27 14:10:18 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-27 14:10:18 +0800
commit83036d85a38729adf8fad5bc9bf38a06c183adf0 (patch)
treed3aadf94e4f337a8645b689dafcc7ef3e783025f /features/dataLoader/index.js
parent7c372e66ded6b80dbe58f8fc89d1ec14019bc5cb (diff)
downloadSoopyV2-83036d85a38729adf8fad5bc9bf38a06c183adf0.tar.gz
SoopyV2-83036d85a38729adf8fad5bc9bf38a06c183adf0.tar.bz2
SoopyV2-83036d85a38729adf8fad5bc9bf38a06c183adf0.zip
+ bestiary hud elements (hopefully not scuffed)
Diffstat (limited to 'features/dataLoader/index.js')
-rw-r--r--features/dataLoader/index.js14
1 files changed, 14 insertions, 0 deletions
diff --git a/features/dataLoader/index.js b/features/dataLoader/index.js
index b933e31..849e0fd 100644
--- a/features/dataLoader/index.js
+++ b/features/dataLoader/index.js
@@ -23,6 +23,8 @@ class DataLoader extends Feature {
this.registerStep(true, 2, this.step)
+ this.registerStep(false, 170, this.loadApiStepThing)
+
this.registerEvent("worldLoad", this.worldLoad)
this.api_loaded_event = this.createCustomEvent("apiLoad")
@@ -42,13 +44,19 @@ class DataLoader extends Feature {
this.worldLoaded = true
this.loadApi()
+
+ this.firstLoaded = false
}
worldLoad() {
this.area = undefined
this.areaFine = undefined
+ this.loadApiData("skyblock", false)
}
+ loadApiStepThing() {
+ this.loadApiData("skyblock", false)
+ }
loadApi() {
fetch("http://soopymc.my.to/api/v2/player_skyblock/" + Player.getUUID().replace(/-/g, "")).json(data => {
@@ -87,6 +95,12 @@ class DataLoader extends Feature {
}
step() { //2fps
+ if (!this.firstLoaded) {
+ if (!(this.FeatureManager.features["globalSettings"] === undefined || this.FeatureManager.features["globalSettings"].class.apiKeySetting === undefined)) {
+ this.loadApiData("skyblock", false)
+ this.firstLoaded = true
+ }
+ }
this.isInSkyblock = Scoreboard.getTitle()?.removeFormatting().includes("SKYBLOCK")
if (!this.isInSkyblock) {