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/slayers | |
parent | 73e3e7465ab2888f869bf805c266e748eced4c4a (diff) | |
download | SoopyV2-b3f12aa6dffc7fc5841e6d7863269740079a9ef7.tar.gz SoopyV2-b3f12aa6dffc7fc5841e6d7863269740079a9ef7.tar.bz2 SoopyV2-b3f12aa6dffc7fc5841e6d7863269740079a9ef7.zip |
small optimisation
Diffstat (limited to 'features/slayers')
-rw-r--r-- | features/slayers/index.js | 27 |
1 files changed, 14 insertions, 13 deletions
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 |