aboutsummaryrefslogtreecommitdiff
path: root/features/slayers
diff options
context:
space:
mode:
authorSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-25 22:25:39 +0800
committerSoopyboo32 <49228220+Soopyboo32@users.noreply.github.com>2022-06-25 22:25:39 +0800
commit24f2fddb6f70576bc101021637014af1bdbb68b6 (patch)
treec65d9c01a6d475e4737fc54ca67ae12e3c7d8fe3 /features/slayers
parentb1bc366e52cf719f0e3f01719fd787e7873baf84 (diff)
downloadSoopyV2-24f2fddb6f70576bc101021637014af1bdbb68b6.tar.gz
SoopyV2-24f2fddb6f70576bc101021637014af1bdbb68b6.tar.bz2
SoopyV2-24f2fddb6f70576bc101021637014af1bdbb68b6.zip
+ finish performance thing (mostly)
+ optimisations for slayer hide 0hp nametags
Diffstat (limited to 'features/slayers')
-rw-r--r--features/slayers/index.js16
1 files changed, 7 insertions, 9 deletions
diff --git a/features/slayers/index.js b/features/slayers/index.js
index 590970a..348f7c4 100644
--- a/features/slayers/index.js
+++ b/features/slayers/index.js
@@ -305,21 +305,19 @@ class Slayers extends Feature {
}
if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue()) {
- World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach(name => {
- let MobName = `${name.getName().removeFormatting().split(" ")[0]} ${name.getName().removeFormatting().split(" ")[1]}`
+ let entitys = World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand)
+ for (let name of entitys) {
+ 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())) {
- this.minibossEntity.push([new Entity(name.getEntity()), this.lastSlayerType]);
+ this.minibossEntity.push([name, this.lastSlayerType]);
}
if (this.betterHideDeadEntity.getValue()) {
- if (name.getName().removeFormatting().split(" ")[name.getName().removeFormatting().split(" ").length - 1] === "0❤" ||
- (
- name.getName().removeFormatting().split(" ")[name.getName().removeFormatting().split(" ").length - 1].split("/")[0] === "0"
- && name.getName().removeFormatting().includes("❤"))
- ) {
+ if (nameSplit[nameSplit.length - 1][0] === "0" && nameSplit[nameSplit.length - 1].endsWith("❤")) {
name.getEntity()[m.setAlwaysRenderNameTag](false)
}
}
- });
+ }
}
}