diff options
author | EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> | 2022-07-24 01:12:19 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-07-24 01:12:19 +0800 |
commit | 7611a97716b073634ab42ae7a9baa74f57f4c757 (patch) | |
tree | 721cebf9cf4880607660be708a82a4b4c132eccb /features/events/index.js | |
parent | 2aee47bfab2169eaed3b97890c82e684e8a1a1c3 (diff) | |
download | SoopyV2-7611a97716b073634ab42ae7a9baa74f57f4c757.tar.gz SoopyV2-7611a97716b073634ab42ae7a9baa74f57f4c757.tar.bz2 SoopyV2-7611a97716b073634ab42ae7a9baa74f57f4c757.zip |
+ fix
improve fps
Diffstat (limited to 'features/events/index.js')
-rw-r--r-- | features/events/index.js | 36 |
1 files changed, 28 insertions, 8 deletions
diff --git a/features/events/index.js b/features/events/index.js index d7280db..1e5ef52 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -69,6 +69,7 @@ class Events extends Feature { this.MythMobsHPGuiElement = new ToggleSetting("Render Mythological Mobs hp on your screen", "This will help you to know their HP.", true, "myth_mobs_hp", this).contributor("EmeraldMerchant"); this.MythMobsHP = new HudTextElement().setToggleSetting(this.MythMobsHPGuiElement).setLocationSetting(new LocationSetting("Mythological Mobs Hp Location", "Allows you to edit the location of Mythological Mobs hp", "myth_mobs_location", this, [10, 50, 1, 1]).requires(this.MythMobsHPGuiElement).editTempText("&8[&7Lv750&8] &2Exalted Minos Inquisitor &a40M&f/&a40M&c❤&r")); this.hudElements.push(this.MythMobsHP); + this.Mobs = [] this.lastDing = 0 this.lastDingPitch = 0 @@ -123,7 +124,8 @@ class Events extends Feature { } }) - this.registerStep(true, 4, this.step_4fps) + this.registerStep(true, 1, this.step_1fps) + this.registerStep(true, 10, this.step_10fps) this.registerCommand("sethubwarp", () => { warpData.worldload = [Player.getX(), Player.getY(), Player.getZ()] @@ -131,18 +133,26 @@ class Events extends Feature { }) } - step_4fps() { + step_1fps() { if (!this.MythMobsHPGuiElement.getValue()) return - if (!this.showingWaypoints) return - World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((mob) => { let name = mob.getName() - if ((name.includes("Exalted") || name.includes("Stalwart")) && !name.split(" ")[2].startsWith("0")) { - this.Mobs.push(name) + if (!this.Mobs?.map(a => a.getUUID().toString()).includes(mob.getUUID().toString())) { + if ((name.includes("Exalted") || name.includes("Stalwart")) && !name.split(" ")[2].startsWith("0")) { + this.Mobs.push(mob) + } } }) - this.MythMobsHP.setText(this.Mobs.join("\n")) - this.Mobs = [] + this.Mobs = this.Mobs.filter((e) => !e[f.isDead]); + } + + step_10fps() { + if (!this.MythMobsHPGuiElement.getValue()) return + let names = [] + this.Mobs.forEach(nameTag => { + names.push(nameTag.getName()) + }) + this.MythMobsHP.setText(names.join("\n")) } entityJoinWorldEvent(e) { @@ -244,8 +254,15 @@ class Events extends Feature { } }) + let mythMobs = [] this.todoE.forEach(e => { e = new Entity(e) + try { + let health = e.getName().removeFormatting().split(" ")[4]?.split("/")[0] + if (this.MythMobsHP.getValue() && health != 0 && (e.getName().removeFormatting().includes("Exalted") || e.getName().removeFormatting().includes("Stalwart"))) { + mythMobs.push(e.getName()) + } + } catch (e) { }//not mytho mob if (e.getName().toLowerCase().includes("inquis") && Math.abs(e.getY() - Player.getY()) < 10 && Math.abs(e.getX() - Player.getX()) < 10 && Math.abs(e.getZ() - Player.getZ()) < 10) { let loc = [e.getX(), e.getY() - 1, e.getZ()] @@ -264,6 +281,9 @@ class Events extends Feature { } }) this.todoE = [] + if (mythMobs.length >= 1) { + this.mythMobsElement.setText(mythMobs.join("\n")) + } if (Player.getContainer().getName() === "Fast Travel") { this.openedWarpsMenu = true |