diff options
-rw-r--r-- | featureClass/class.js | 10 | ||||
-rw-r--r-- | featureClass/featureManager.js | 12 | ||||
-rw-r--r-- | features/dungeonSolvers/index.js | 1 | ||||
-rw-r--r-- | features/events/index.js | 7 | ||||
-rw-r--r-- | features/globalSettings/index.js | 2 | ||||
-rw-r--r-- | features/hud/index.js | 1 |
6 files changed, 16 insertions, 17 deletions
diff --git a/featureClass/class.js b/featureClass/class.js index c796b28..13ddf81 100644 --- a/featureClass/class.js +++ b/featureClass/class.js @@ -72,10 +72,16 @@ class Feature { delete this.soopyEvents[event.id] } - registerForge(event, func){ - let theEvent = this.FeatureManager.registerForge(event, func, this) + registerForge(event, func, messageIfError){ + let theEvent + try{ + theEvent = this.FeatureManager.registerForge(event, func, this) this.forgeEvents[theEvent.id] = theEvent + }catch(e){ + if(!messageIfError) messageIfError = "An error occured while registering the event " + event.toString() + ", this may cause " + this.constructor.name + " to not work properly." + ChatLib.chat(this.FeatureManager.messagePrefix + messageIfError) + } return theEvent } diff --git a/featureClass/featureManager.js b/featureClass/featureManager.js index 70c2cc6..2502b02 100644 --- a/featureClass/featureManager.js +++ b/featureClass/featureManager.js @@ -585,14 +585,4 @@ if(!global.soopyv2featuremanagerthing){ global.soopyv2featuremanagerthing = undefined }) } -export default global.soopyv2featuremanagerthing - - -function getField(e, field){ - - let field2 = e.class.getDeclaredField(field); - - field2.setAccessible(true) - - return field2.get(e) -}
\ No newline at end of file +export default global.soopyv2featuremanagerthing
\ No newline at end of file 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 |