From bc1444d6bb685653f430fdf1c7cffaf1f374330e Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:35:41 +0800 Subject: small changes + clears out emanBoss data when player's boss spawned, just in case it hides summons + changed the for() to forEach() cuz it doesnt work on mini spawned from mini (flickering .isDead from the old mini thats killed on the new mini that spawned cuz less frequency ig) --- features/slayers/index.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/features/slayers/index.js b/features/slayers/index.js index 56551e1..102fa59 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -377,8 +377,7 @@ class Slayers extends Feature { } if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { - let entities = World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand) - for (let name of entities) { + World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((name) => { let nameSplit = name.getName().removeFormatting().split(" ") let MobName = `${nameSplit[0]} ${nameSplit[1]}` if (this.BoxAroundMiniboss.getValue() && !this.bossSpawnedMessage && this.Miniboss[this.lastSlayerType]?.has(MobName) && !this.minibossEntity.map(a => a[0].getUUID().toString()).includes(name.getUUID().toString())) { @@ -396,7 +395,7 @@ class Slayers extends Feature { this.summonEntity.push(name) } } - }; + }); } } @@ -776,6 +775,9 @@ class Slayers extends Feature { socketConnection.sendSlayerSpawnData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); this.lastBossSpawned = Date.now(); } + if (!this.bossSpawnedMessage && this.emanBoss) { + this.emanBoss = undefined + } if (!this.bossSpawnedMessage && !this.emanBoss) { this.nextIsBoss = Date.now(); } -- cgit