aboutsummaryrefslogtreecommitdiff
path: root/features/slayers
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-06 21:40:49 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-05-06 21:40:49 +0800
commitf0cfad5af93244618d5a60c88b1c0a4837e629ae (patch)
tree062a301f34c8e6d3284fa845676b23b2ab8d7f9a /features/slayers
parente2e2d676ee056e9f44f6c67e29f0952b9ef956b2 (diff)
downloadSoopyV2-f0cfad5af93244618d5a60c88b1c0a4837e629ae.tar.gz
SoopyV2-f0cfad5af93244618d5a60c88b1c0a4837e629ae.tar.bz2
SoopyV2-f0cfad5af93244618d5a60c88b1c0a4837e629ae.zip
+ Many performance improvements
+ Fix rescue mission waypoints
Diffstat (limited to 'features/slayers')
-rw-r--r--features/slayers/index.js9
1 files changed, 6 insertions, 3 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js
index db5983c..6ebeb3b 100644
--- a/features/slayers/index.js
+++ b/features/slayers/index.js
@@ -90,7 +90,7 @@ class Slayers extends Feature {
this.lastBossNotSpawnedTime = 0;
this.lastBossSpawned = 0;
- this.registerEvent("renderOverlay", this.renderOverlay);
+ this.registerEvent("renderOverlay", this.renderOverlay).registeredWhen(() => this.spawnAlert.getValue() || this.slainAlert.getValue());
this.registerSoopy("apiLoad", this.apiLoad);
if (this.FeatureManager.features["dataLoader"] && this.FeatureManager.features["dataLoader"].class.lastApiData.skyblock) {
@@ -114,11 +114,12 @@ class Slayers extends Feature {
this.lastServer = undefined
this.lastSentServer = 0
this.slayerLocationDataH = {}
+ this.hasQuest = false
this.entityAttackEventLoaded = false;
this.entityAttackEventE = undefined;
- this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent);
+ this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent).registeredWhen(() => this.hasQuest);
this.registerEvent("tick", this.tick);
this.registerEvent("renderWorld", this.renderWorld);
this.registerEvent("worldLoad", this.worldLoad);
@@ -224,7 +225,7 @@ class Slayers extends Feature {
} else {
if (this.entityAttackEventLoaded) {
this.entityAttackEventLoaded = false;
- this.unregisterForge(this.entityAttackEventE);
+ this.entityAttackEventE.unregister()
}
}
@@ -237,10 +238,12 @@ class Slayers extends Feature {
let lastBossSlainMessage = this.bossSlainMessage
this.bossSlainMessage = false;
+ this.hasQuest = false
let dis1 = false;
this.dulkirThingElement.setText("")
Scoreboard.getLines().forEach((line, i) => {
if (ChatLib.removeFormatting(line.getName()).includes("Slayer Quest")) {
+ this.hasQuest = true
let slayerInfo = ChatLib.removeFormatting(Scoreboard.getLines()[i - 1].getName().replace(/ยง/g, "&"));
let levelString = slayerInfo.split(" ").pop().trim();
let slayerLevelToExp = {