From f0cfad5af93244618d5a60c88b1c0a4837e629ae Mon Sep 17 00:00:00 2001 From: Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> Date: Fri, 6 May 2022 21:40:49 +0800 Subject: + Many performance improvements + Fix rescue mission waypoints --- features/events/index.js | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) (limited to 'features/events') diff --git a/features/events/index.js b/features/events/index.js index 8ab5f86..51081fd 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -25,7 +25,6 @@ class Events extends Feature { this.showingWaypoints = false this.lastPath = [] this.updatingPath = false - this.hudElements = [] this.lastPathCords = undefined @@ -48,24 +47,17 @@ class Events extends Feature { this.shinyBlockOverlayEnabled = new ToggleSetting("Shiny blocks highlight", "Will highlight shiny blocks in the end", false, "shiny_blocks_overlay", this) this.registerEvent("worldLoad", this.worldLoad) - this.registerEvent("spawnParticle", this.spawnParticle) - this.registerEvent("renderWorld", this.renderWorld) - this.registerEvent("renderOverlay", this.renderOverlay) + this.registerEvent("spawnParticle", this.spawnParticle).registeredWhen(() => this.showingWaypoints) + this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.showingWaypoints || this.shinyBlockOverlayEnabled.getValue()) this.registerStep(true, 2, this.step) this.registerStep(false, 5, this.step_5s) - this.registerEvent("soundPlay", this.playSound) + this.registerEvent("soundPlay", this.playSound).registeredWhen(() => this.showingWaypoints) this.registerChat("&r&eYou dug out a Griffin Burrow! &r&7(${*}/4)&r", this.burrialClicked) this.registerChat("&r&eYou finished the Griffin burrow chain! &r&7(4/4)&r", this.burrialClicked) } - renderOverlay() { - for (let element of this.hudElements) { - element.render() - } - } - renderWorld(ticks) { this.shinyBlocks.forEach(([loc]) => { drawBoxAtBlockNotVisThruWalls(loc[0], loc[1], loc[2], 0, 255, 0, 0.1, 0.1) -- cgit