aboutsummaryrefslogtreecommitdiff
path: root/features
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-23 22:21:23 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-01-23 22:21:23 +0800
commitfe3449248bb556779fc1ef8ee216efeda43e8592 (patch)
treec96fe6a66e8f9ea7a519e1027572b3d8ae53e331 /features
parenta0158cef8a59537145286ad96fd3daafc5238cf8 (diff)
downloadSoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.tar.gz
SoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.tar.bz2
SoopyV2-fe3449248bb556779fc1ef8ee216efeda43e8592.zip
add error handling to registering forge event, and other fixes and cleanups
Diffstat (limited to 'features')
-rw-r--r--features/dungeonSolvers/index.js1
-rw-r--r--features/events/index.js7
-rw-r--r--features/globalSettings/index.js2
-rw-r--r--features/hud/index.js1
4 files changed, 7 insertions, 4 deletions
diff --git a/features/dungeonSolvers/index.js b/features/dungeonSolvers/index.js
index 83c8e24..2d47441 100644
--- a/features/dungeonSolvers/index.js
+++ b/features/dungeonSolvers/index.js
@@ -155,6 +155,7 @@ class DungeonSolvers extends Feature {
let endPoint1 = this.eMovingThing[skull.getUUID().toString()].endPoint;
let endPoint2 = this.eMovingThing[skull.getUUID().toString()].endPointLast;
let endPointUpdated = Math.min(Date.now() - this.eMovingThing[skull.getUUID().toString()].endPointUpdated, 100);
+ if(!endPoint2) return
let endPoint = [endPoint2[0] + ((endPoint1[0] - endPoint2[0]) * endPointUpdated) / 100, endPoint2[1] + ((endPoint1[1] - endPoint2[1]) * endPointUpdated) / 100, endPoint2[2] + ((endPoint1[2] - endPoint2[2]) * endPointUpdated) / 100];
let pingPoint = [startPoint[0] + xSpeed2 * this.ping, startPoint[1] + ySpeed2 * this.ping, startPoint[2] + zSpeed2 * this.ping];
diff --git a/features/events/index.js b/features/events/index.js
index 99b5d2c..bbe1b6d 100644
--- a/features/events/index.js
+++ b/features/events/index.js
@@ -23,6 +23,7 @@ class Events extends Feature {
}
this.lastRequestTime = 0
this.nextUpdateApprox = -1
+ this.lastWorldChange = 0
this.lastRequest = 0
this.potentialParticleLocs = {}
this.showingWaypoints = false
@@ -138,7 +139,7 @@ class Events extends Feature {
}
})
- let showingWaypointsNew = hasDianaShovle && this.FeatureManager.features["dataLoader"].class.area === "Hub" && this.burrialWaypointsEnabled.getValue()
+ let showingWaypointsNew = (this.lastWorldChange+5000<Date.now()?hasDianaShovle && this.FeatureManager.features["dataLoader"].class.area === "Hub" && this.burrialWaypointsEnabled.getValue():this.showingWaypoints)
if(!this.showingWaypoints && showingWaypointsNew){
this.loadApi()
@@ -175,9 +176,9 @@ class Events extends Feature {
this.burrialData.locations = []
this.burrialData.historicalLocations = []
- this.showingWaypoints = false
-
this.nextUpdateApprox = Date.now()
+
+ this.lastWorldChange = Date.now()
}
loadApi(){
diff --git a/features/globalSettings/index.js b/features/globalSettings/index.js
index 09daa6f..684561f 100644
--- a/features/globalSettings/index.js
+++ b/features/globalSettings/index.js
@@ -119,7 +119,7 @@ class Hud extends Feature {
return "&a"+firstLetterCapital(dungeons)+": &b" + numberWithCommas(Math.round(sbData.data.profiles[sbData.data.stats.bestProfileId].members[userData.data.uuid].weight.dungeons[dungeons].total)) + " &7(" + numberWithCommas(Math.round(sbData.data.profiles[sbData.data.stats.bestProfileId].members[userData.data.uuid].weight.dungeons[dungeons].weight)) + " | " + numberWithCommas(Math.round(sbData.data.profiles[sbData.data.stats.bestProfileId].members[userData.data.uuid].weight.dungeons[dungeons].overflow)) + ")"
}).filter(a=>a).join("\n"))).chat()
if(sbData.data.stats.bestProfileId !== sbData.data.stats.currentProfileId){
- ChatLib.chat(userData.data.stats.nameWithPrefix + "'s senither weight (best profile):")
+ ChatLib.chat(userData.data.stats.nameWithPrefix + "'s senither weight (current profile):")
ChatLib.chat("&aTotal: &b" + numberWithCommas(Math.round(sbData.data.profiles[sbData.data.stats.currentProfileId].members[userData.data.uuid].weight.total)))
new Message(new TextComponent("&aSkills: &b" + numberWithCommas(Math.round(sbData.data.profiles[sbData.data.stats.currentProfileId].members[userData.data.uuid].weight.skill.total)))
.setHover("show_text", Object.keys(sbData.data.profiles[sbData.data.stats.currentProfileId].members[userData.data.uuid].weight.skill).map(skill=>{
diff --git a/features/hud/index.js b/features/hud/index.js
index a72f850..39b41db 100644
--- a/features/hud/index.js
+++ b/features/hud/index.js
@@ -296,6 +296,7 @@ class Hud extends Feature {
}
step(){
+ if(!Player.getPlayer()) return
this.updateHudThingos()
let fps = 0