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(-) (limited to 'features/slayers') 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 From 41c172e2371f6bde85e990a2071e583b99c472c3 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 28 Jun 2022 15:56:48 +0800 Subject: small fix + automatically assume closest (<5 blocks) boss as your boss if module didnt find a boss + delete eman boss data if you already picked others' boss and your boss spawned --- features/slayers/index.js | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 102fa59..cacc1cc 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -165,6 +165,7 @@ class Slayers extends Feature { this.bossSpawnedMessage = false; this.lastBossNotSpawnedTime = 0; this.lastBossSpawned = 0; + this.cannotFindEmanBoss = false; this.registerEvent("renderOverlay", this.renderOverlay).registeredWhen(() => this.spawnAlert.getValue() || this.slainAlert.getValue()); @@ -298,6 +299,7 @@ class Slayers extends Feature { this.summonEntity = [] this.warnAfterBoss = false this.canCaptureSummonHPInfo = false + this.cannotFindEmanBoss = false } renderEntity(entity, pos, partialTicks, event) { @@ -454,6 +456,10 @@ class Slayers extends Feature { this.emanBoss = new Entity(e); this.nextIsBoss = false; } + if (this.cannotFindEmanBoss && ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 < 5)) { + this.emanBoss = new Entity(e); + this.cannotFindEmanBoss = false + } // just makes it to work on all eman slayers if (this.allEmanBosses.getValue()) { if ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 > 20) return @@ -768,18 +774,20 @@ class Slayers extends Feature { socketConnection.sendSlayerSpawnData({ loc: null }); } this.bossSlainMessage = true; + this.cannotFindEmanBoss = false } if (line.getName().includes("Slay the boss!")) { if (!this.bossSpawnedMessage) { 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(); + if (this.emanBoss) { + this.emanBoss = undefined + } else { + this.nextIsBoss = Date.now(); + } + } else if (!this.emanBoss) { + this.cannotFindEmanBoss = true } dis1 = true; @@ -833,6 +841,7 @@ class Slayers extends Feature { this.summonAtHPShouldWarn = undefined; this.warnAfterBoss = false this.canCaptureSummonHPInfo = false + this.cannotFindEmanBoss = false } onDisable() { -- cgit From aa430898a4e6528aef5db717a7964c46e4a4906e Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:06:00 +0800 Subject: another fix = make the assuming eman boss if data is undefined thing keep scanning thru all entities until it finds one, instead of only scanning the ones that just joined world --- features/slayers/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index cacc1cc..31f19f0 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -378,8 +378,14 @@ class Slayers extends Feature { this.renderEntityEvent.unregister(); } - if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { + if (this.cannotFindEmanBoss || this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((name) => { + if (this.cannotFindEmanBoss) { + if ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 < 5) { + this.emanBoss = new Entity(e); + this.cannotFindEmanBoss = false + } + } 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())) { -- cgit From fd36d638444ad9188d6e49fa3f7ba36212eef6ac Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 28 Jun 2022 16:59:51 +0800 Subject: more fixes - fixed a bug that the warning messages still show up when summon features are off - fixed a bug that the warning messages showed up multiple times when you use multiple non-tank summons + added a main toggle for those summon features --- features/slayers/index.js | 21 ++++++++++++++++----- 1 file changed, 16 insertions(+), 5 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 31f19f0..35fe3c4 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -39,6 +39,7 @@ class Slayers extends Feature { this.MinibossAlert = new ToggleSetting("Alert when miniboss spawned nearby", "Pops up notification when a miniboss spawned", false, "miniboss_title_ping", this).contributor("EmeraldMerchant"); this.MinibossPing = new ToggleSetting("Also make a sound when miniboss spawned", "Sound ping when a miniboss spawned", false, "miniboss_sound_ping", this).contributor("EmeraldMerchant"); this.BoxAroundMiniboss = new ToggleSetting("Draws boxes around minibosses.", "If they are too far away it doesnt draw.", false, "box_around_miniboss", this).contributor("EmeraldMerchant"); + this.MinibossOffWhenBoss = new ToggleSetting("Disable miniboss features when your boss spawned", "this will boost your fps a little bit during boss", true, "miniboss_off_when_boss", this).contributor("EmeraldMerchant"); this.betterHideDeadEntity = new ToggleSetting("Also hides mob nametag when it's dead.", "An improvement for Skytils's hide dead entity", false, "hide_dead_mob_nametag", this); @@ -65,10 +66,11 @@ class Slayers extends Feature { this.whenToShowHitsLeft = new TextSetting("Show hits left timing", "At how much hp should the hits left thing be visible", "", "eman_hp_left", this, "How much hp (Unit: M, enter a valid value 0-300)", false).requires(this.rcmDaeAxeSupport).contributor("EmeraldMerchant"); this.thunderLevel = new TextSetting("Thunderlord Level", "What thunderlord level you have on your hyperion", "", "thunderlord_level", this, "Thunderlord level (only supports 5/6/7)", false).requires(this.rcmDaeAxeSupport).contributor("EmeraldMerchant"); - this.summonsHideNametag = new ToggleSetting("Hide your summons' nametags", "so u can see your boss more clearly", false, "hide_summons_nametags", this).contributor("EmeraldMerchant"); - this.summonsShowNametag = new ToggleSetting("Renders your summons' HP on screen", "this shows your summons' hp on screen", false, "show_summons_hp", this).contributor("EmeraldMerchant"); - this.summonsLowWarning = new ToggleSetting("Warns you when a summon is low", "this warns you after a delay after each bosses, until you respawn them", false, "warn_when_summon_low", this).contributor("EmeraldMerchant"); - this.summonHPGuiElement = new ToggleSetting("Render the HP of your summons on your screen", "This will help you to know how much HP your summons have left while hide summons nametags is on", false, "summon_hp_hud", this).contributor("EmeraldMerchant"); + this.summonFeatureMaster = new ToggleSetting("Summon Features Main Toggle", "enable this to use summon features", false, "hide_summons_nametags", this).contributor("EmeraldMerchant"); + this.summonsHideNametag = new ToggleSetting("Hide your summons' nametags", "so u can see your boss more clearly", false, "hide_summons_nametags", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); + this.summonsShowNametag = new ToggleSetting("Renders your summons' HP on screen", "this shows your summons' hp on screen", false, "show_summons_hp", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); + this.summonsLowWarning = new ToggleSetting("Warns you when a summon is low", "this warns you after a delay after each bosses, until you respawn them", false, "warn_when_summon_low", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); + this.summonHPGuiElement = new ToggleSetting("Render the HP of your summons on your screen", "This will help you to know how much HP your summons have left while hide summons nametags is on", false, "summon_hp_hud", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); this.summonHPElement = new HudTextElement() .setText("") .setToggleSetting(this.summonHPGuiElement) @@ -175,8 +177,15 @@ class Slayers extends Feature { } this.registerChat("&r&aYou have spawned your ${soul} &r&asoul! &r&d(${mana} Mana)&r", (soul, mana) => { + if (!this.summonFeatureMaster || (this.summonFeatureMaster && (this.summonsHideNametag || this.summonsShowNametag || this.summonHPGuiElement || this.summonsLowWarning))) return if (!soul.removeFormatting().includes("Tank Zombie")) { - ChatLib.chat("&6[MVP&0++&6] Soopyboo32&7: &dMy mod only support Tank Zombie summons!\n&6[MVP&0++&6] Soopyboo32&7: &cPlease either use them or DISABLE the feature!\n&6[MVP&0++&6] Soopyboo32&7: &c&lDon't dm me i didn't make this warning LMAO!") + if (!this.wrongSummons) { + delay(300, () => { + ChatLib.chat("&6[MVP&0++&6] Soopyboo32&7: &dMy mod only support Tank Zombie summons!\n&6[MVP&0++&6] Soopyboo32&7: &cPlease either use them or DISABLE the feature!\n&6[MVP&0++&6] Soopyboo32&7: &c&lDon't dm me i didn't make this warning LMAO!") + this.wrongSummons = false + }) + } + this.wrongSummons = true return } if (this.summonAtHPShouldWarn != 0 && !this.canCaptureSummonHPInfo) { @@ -211,6 +220,7 @@ class Slayers extends Feature { this.summonAtHPShouldWarn = 0 this.warnAfterBoss = false this.canCaptureSummonHPInfo = false + this.wrongSummons = false this.Miniboss = { zombie: new Set(["Revenant Sycophant", "Revenant Champion", "Deformed Revenant", "Atoned Champion", "Atoned Revenant"]), @@ -386,6 +396,7 @@ class Slayers extends Feature { this.cannotFindEmanBoss = false } } + if (this.MinibossOffWhenBoss.getValue() && !this.bossSpawnedMessage) return 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())) { -- cgit From 4d7182ba8b84b0dbd773dedb6db1c84c7aee2dd0 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 28 Jun 2022 17:06:57 +0800 Subject: fixed summon toggle master and rearranged 2 features' positioning order in settings menu --- features/slayers/index.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 35fe3c4..ccb6ed1 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -66,20 +66,19 @@ class Slayers extends Feature { this.whenToShowHitsLeft = new TextSetting("Show hits left timing", "At how much hp should the hits left thing be visible", "", "eman_hp_left", this, "How much hp (Unit: M, enter a valid value 0-300)", false).requires(this.rcmDaeAxeSupport).contributor("EmeraldMerchant"); this.thunderLevel = new TextSetting("Thunderlord Level", "What thunderlord level you have on your hyperion", "", "thunderlord_level", this, "Thunderlord level (only supports 5/6/7)", false).requires(this.rcmDaeAxeSupport).contributor("EmeraldMerchant"); - this.summonFeatureMaster = new ToggleSetting("Summon Features Main Toggle", "enable this to use summon features", false, "hide_summons_nametags", this).contributor("EmeraldMerchant"); + this.summonFeatureMaster = new ToggleSetting("Summon Features Main Toggle", "enable this to use summon features", false, "summons_master", this).contributor("EmeraldMerchant"); this.summonsHideNametag = new ToggleSetting("Hide your summons' nametags", "so u can see your boss more clearly", false, "hide_summons_nametags", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); this.summonsShowNametag = new ToggleSetting("Renders your summons' HP on screen", "this shows your summons' hp on screen", false, "show_summons_hp", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); this.summonsLowWarning = new ToggleSetting("Warns you when a summon is low", "this warns you after a delay after each bosses, until you respawn them", false, "warn_when_summon_low", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); + this.warnDelay = new TextSetting("Delay for warning", "How long should it wait after the boss to warn you a summon is low", "3", "summon_warn_delay", this, "(seconds)", false).requires(this.summonsLowWarning).contributor("EmeraldMerchant"); + this.summonPercentage = new TextSetting("When will it start warning you", "Below how many % hp (your summons) should it start warning you", "30", "summon_warn_percentage", this, "(%)", false).requires(this.summonsLowWarning).contributor("EmeraldMerchant"); this.summonHPGuiElement = new ToggleSetting("Render the HP of your summons on your screen", "This will help you to know how much HP your summons have left while hide summons nametags is on", false, "summon_hp_hud", this).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); this.summonHPElement = new HudTextElement() .setText("") .setToggleSetting(this.summonHPGuiElement) .setLocationSetting(new LocationSetting("Summon HP Location", "Allows you to edit the location of your summons' HP info", "summon_hp_location", this, [10, 50, 1, 1]).requires(this.summonHPGuiElement).editTempText("&a160k&c❤ &a160k&c❤ &a160k&c❤ &a160k&c❤").contributor("EmeraldMerchant")); this.hudElements.push(this.summonHPElement); - - this.warnDelay = new TextSetting("Delay for warning", "How long should it wait after the boss to warn you a summon is low", "3", "summon_warn_delay", this, "(seconds)", false).requires(this.summonsLowWarning).contributor("EmeraldMerchant"); - this.summonPercentage = new TextSetting("When will it start warning you", "Below how many % hp (your summons) should it start warning you", "30", "summon_warn_percentage", this, "(%)", false).requires(this.summonsLowWarning).contributor("EmeraldMerchant"); - this.maxSummons = new TextSetting("Maximum amount of your summons", "How many summons you are using", "", "max_summons", this, "Max Summons (1-8)", false).contributor("EmeraldMerchant"); + this.maxSummons = new TextSetting("Maximum amount of your summons", "How many summons you are using", "", "max_summons", this, "Max Summons (1-8)", false).requires(this.summonFeatureMaster).contributor("EmeraldMerchant"); this.emanLazerTimer = new ToggleSetting("Adds a timer for the boss lazer phase", "The timer will be inside the boss's body during the phase", true, "eman_lazer_timer", this); -- cgit From 19e3b595590159a15b16f63a0594c7a84f8dc86e Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 28 Jun 2022 17:27:15 +0800 Subject: fixed a big bug i made a return in the wrong place ;-; --- features/slayers/index.js | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index ccb6ed1..1d1b464 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -176,7 +176,14 @@ class Slayers extends Feature { } this.registerChat("&r&aYou have spawned your ${soul} &r&asoul! &r&d(${mana} Mana)&r", (soul, mana) => { - if (!this.summonFeatureMaster || (this.summonFeatureMaster && (this.summonsHideNametag || this.summonsShowNametag || this.summonHPGuiElement || this.summonsLowWarning))) return + if (!this.summonFeatureMaster) { + ChatLib.chat("1") + return + } else if (!this.summonsHideNametag && !this.summonsShowNametag && !this.summonHPGuiElement && !this.summonsLowWarning) { + ChatLib.chat("2") + return + } + ChatLib.chat("3") if (!soul.removeFormatting().includes("Tank Zombie")) { if (!this.wrongSummons) { delay(300, () => { @@ -395,15 +402,16 @@ class Slayers extends Feature { this.cannotFindEmanBoss = false } } - if (this.MinibossOffWhenBoss.getValue() && !this.bossSpawnedMessage) return 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([name, this.lastSlayerType]); - } - if (this.betterHideDeadEntity.getValue()) { - if (nameSplit[nameSplit.length - 1].startsWith("0") && nameSplit[nameSplit.length - 1].endsWith("❤")) { - name.getEntity()[m.setAlwaysRenderNameTag](false) + if (this.MinibossOffWhenBoss.getValue() && !this.bossSpawnedMessage) { + 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([name, this.lastSlayerType]); + } + if (this.betterHideDeadEntity.getValue()) { + if (nameSplit[nameSplit.length - 1].startsWith("0") && nameSplit[nameSplit.length - 1].endsWith("❤")) { + name.getEntity()[m.setAlwaysRenderNameTag](false) + } } } if (this.summonEntity.length === parseInt(this.maxSummons.getValue())) return; -- cgit From 36f4c292f9edde4dbf0789f83f2cabebdb656fbb Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 29 Jun 2022 19:39:42 +0800 Subject: fixed a bug + fixed a bug that it kept on trying to track a boss after quest is failed --- features/slayers/index.js | 41 ++++++++++++++++++++++++----------------- 1 file changed, 24 insertions(+), 17 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 1d1b464..a3ae2d5 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -177,13 +177,10 @@ class Slayers extends Feature { this.registerChat("&r&aYou have spawned your ${soul} &r&asoul! &r&d(${mana} Mana)&r", (soul, mana) => { if (!this.summonFeatureMaster) { - ChatLib.chat("1") return } else if (!this.summonsHideNametag && !this.summonsShowNametag && !this.summonHPGuiElement && !this.summonsLowWarning) { - ChatLib.chat("2") return } - ChatLib.chat("3") if (!soul.removeFormatting().includes("Tank Zombie")) { if (!this.wrongSummons) { delay(300, () => { @@ -394,16 +391,28 @@ class Slayers extends Feature { this.renderEntityEvent.unregister(); } - if (this.cannotFindEmanBoss || this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { + if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((name) => { if (this.cannotFindEmanBoss) { - if ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 < 5) { - this.emanBoss = new Entity(e); + if (this.bossSpawnedMessage) { + this.emanBoss = undefined + this.cannotFindEmanBoss = false + } + if (name.getName().removeFormatting().includes("Voidgloom Seraph") && ((name.getX() - Player.getX()) ** 2 + (name.getY() - Player.getY()) ** 2 + (name.getZ() - Player.getZ()) ** 2 < 25)) { + this.emanBoss = name this.cannotFindEmanBoss = false } } let nameSplit = name.getName().removeFormatting().split(" ") let MobName = `${nameSplit[0]} ${nameSplit[1]}` + if (this.summonEntity.length !== parseInt(this.maxSummons.getValue())) { + if (this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { + // 2nd statement makes it to support both tank zombie and super tank zombie + if (nameSplit[0] === `${Player.getName()}'s` && `${nameSplit[nameSplit.length - 3]} ${nameSplit[nameSplit.length - 2]}` === "Tank Zombie" && !this.summonEntity?.map(a => a.getUUID().toString()).includes(name.getUUID().toString())) { + this.summonEntity.push(name) + } + } + } if (this.MinibossOffWhenBoss.getValue() && !this.bossSpawnedMessage) { 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([name, this.lastSlayerType]); @@ -414,13 +423,6 @@ class Slayers extends Feature { } } } - if (this.summonEntity.length === parseInt(this.maxSummons.getValue())) return; - if (this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { - // 2nd statement makes it to support both tank zombie and super tank zombie - if (nameSplit[0] === `${Player.getName()}'s` && `${nameSplit[nameSplit.length - 3]} ${nameSplit[nameSplit.length - 2]}` === "Tank Zombie" && !this.summonEntity?.map(a => a.getUUID().toString()).includes(name.getUUID().toString())) { - this.summonEntity.push(name) - } - } }); } } @@ -556,9 +558,12 @@ class Slayers extends Feature { this.warnAfterBoss = true } if (this.canCaptureSummonHPInfo) { - if (!this.summonHPPossibilities.has(summonHP.removeFormatting())) return - this.canCaptureSummonHPInfo = false - this.summonAtHPShouldWarn = this.formatNumber(summonHP) * (parseInt(this.summonPercentage.getValue()) / 100) + if (this.summonHPPossibilities.has(summonHP.removeFormatting())) { + this.canCaptureSummonHPInfo = false + this.summonAtHPShouldWarn = this.formatNumber(summonHP) * (parseInt(this.summonPercentage.getValue()) / 100) + } else { + this.canCaptureSummonHPInfo = false + } } } }) @@ -807,10 +812,12 @@ class Slayers extends Feature { this.lastBossSpawned = Date.now(); if (this.emanBoss) { this.emanBoss = undefined + } else { this.nextIsBoss = Date.now(); } - } else if (!this.emanBoss) { + } + if (this.bossSpawnedMessage && !this.emanBoss) { this.cannotFindEmanBoss = true } -- cgit From f0479a00f189a57d0f2651daed66d2b8e9dd6e16 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 29 Jun 2022 22:56:10 +0800 Subject: fix a place + added a missing ! that makes something not working --- features/slayers/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index a3ae2d5..d8d6874 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -394,11 +394,10 @@ class Slayers extends Feature { if (this.BoxAroundMiniboss.getValue() || this.betterHideDeadEntity.getValue() || this.summonsHideNametag.getValue() || this.summonsShowNametag.getValue() || this.summonsLowWarning.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach((name) => { if (this.cannotFindEmanBoss) { - if (this.bossSpawnedMessage) { + if (!this.bossSpawnedMessage) { this.emanBoss = undefined this.cannotFindEmanBoss = false - } - if (name.getName().removeFormatting().includes("Voidgloom Seraph") && ((name.getX() - Player.getX()) ** 2 + (name.getY() - Player.getY()) ** 2 + (name.getZ() - Player.getZ()) ** 2 < 25)) { + } else if (name.getName().removeFormatting().includes("Voidgloom Seraph") && ((name.getX() - Player.getX()) ** 2 + (name.getY() - Player.getY()) ** 2 + (name.getZ() - Player.getZ()) ** 2 < 25)) { this.emanBoss = name this.cannotFindEmanBoss = false } -- cgit From 60b6e03a01761575b7da4cb1463b15ea5fd4a4ae Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Wed, 29 Jun 2022 23:04:03 +0800 Subject: removed duplicated parts some codes were duplicated after i pasted them onto last commit, idk why --- features/slayers/index.js | 7 ------- 1 file changed, 7 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 044a55d..d8d6874 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -410,13 +410,6 @@ class Slayers extends Feature { if (nameSplit[0] === `${Player.getName()}'s` && `${nameSplit[nameSplit.length - 3]} ${nameSplit[nameSplit.length - 2]}` === "Tank Zombie" && !this.summonEntity?.map(a => a.getUUID().toString()).includes(name.getUUID().toString())) { this.summonEntity.push(name) } - 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([name, this.lastSlayerType]); - } - if (this.betterHideDeadEntity.getValue()) { - if (nameSplit[nameSplit.length - 1][0] === "0" && nameSplit[nameSplit.length - 1].endsWith("❤")) { - name.getEntity()[m.setAlwaysRenderNameTag](false) - } } if (this.MinibossOffWhenBoss.getValue() && !this.bossSpawnedMessage) { -- cgit