diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-23 23:17:32 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2021-12-23 23:17:32 +0800 |
commit | b3f12aa6dffc7fc5841e6d7863269740079a9ef7 (patch) | |
tree | 974b2c714a805826757ed3df5459aadebaa1fa72 /features | |
parent | 73e3e7465ab2888f869bf805c266e748eced4c4a (diff) | |
download | SoopyV2-b3f12aa6dffc7fc5841e6d7863269740079a9ef7.tar.gz SoopyV2-b3f12aa6dffc7fc5841e6d7863269740079a9ef7.tar.bz2 SoopyV2-b3f12aa6dffc7fc5841e6d7863269740079a9ef7.zip |
small optimisation
Diffstat (limited to 'features')
-rw-r--r-- | features/hud/HudTextElement.js | 2 | ||||
-rw-r--r-- | features/slayers/index.js | 27 |
2 files changed, 15 insertions, 14 deletions
diff --git a/features/hud/HudTextElement.js b/features/hud/HudTextElement.js index c5a0635..b56b350 100644 --- a/features/hud/HudTextElement.js +++ b/features/hud/HudTextElement.js @@ -46,7 +46,7 @@ class HudTextElement{ text = this.editTempTextV blackText = "&0" + ChatLib.removeFormatting(text) } - + if(ChatLib.removeFormatting(text) === ""){ text = "&0Empty string" blackText = "&0Empty string" diff --git a/features/slayers/index.js b/features/slayers/index.js index e2adcfd..55748ab 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -120,18 +120,6 @@ class Slayers extends Feature { renderWorld(ticks){ - if(this.FeatureManager.features["dataLoader"].class.isInSkyblock){ - if(!this.entityAttackEventLoaded){ - this.entityAttackEventLoaded = true - this.entityAttackEventE = this.registerForge(net.minecraftforge.event.entity.living.LivingAttackEvent, this.entityAttackEvent) //TODO: Use CT event when ct 2.0 because they made the ct event actually work - } - }else{ - if(this.entityAttackEventLoaded){ - this.entityAttackEventLoaded = false - this.unregisterForge(this.entityAttackEventE) - } - } - Object.values(this.beaconPoints).forEach(line=>{ let lastPoint = undefined line.forEach(p=>{ @@ -162,6 +150,19 @@ class Slayers extends Feature { } tick(){ + + if(this.FeatureManager.features["dataLoader"].class.isInSkyblock){ + if(!this.entityAttackEventLoaded){ + this.entityAttackEventLoaded = true + this.entityAttackEventE = this.registerForge(net.minecraftforge.event.entity.living.LivingAttackEvent, this.entityAttackEvent) //TODO: Use CT event when ct 2.0 because they made the ct event actually work + } + }else{ + if(this.entityAttackEventLoaded){ + this.entityAttackEventLoaded = false + this.unregisterForge(this.entityAttackEventE) + } + } + this.bossSlainMessage = false let dis1 = false Scoreboard.getLines().forEach((line, i) => { @@ -379,4 +380,4 @@ class Slayers extends Feature { module.exports = { class: new Slayers() -} +}
\ No newline at end of file |