From fe3449248bb556779fc1ef8ee216efeda43e8592 Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Sun, 23 Jan 2022 22:21:23 +0800 Subject: add error handling to registering forge event, and other fixes and cleanups --- features/dungeonSolvers/index.js | 1 + features/events/index.js | 7 ++++--- features/globalSettings/index.js | 2 +- features/hud/index.js | 1 + 4 files changed, 7 insertions(+), 4 deletions(-) (limited to 'features') 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+5000a).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 -- cgit