From 4bc49391f24bf6dca559f7ac1d254bf8bd13a291 Mon Sep 17 00:00:00 2001 From: jakeQT <96396730+jakeQT@users.noreply.github.com> Date: Sun, 19 Jun 2022 15:01:06 +0800 Subject: some things + hide summons when boss hp <= 3m ~ 3s after boss is dead --- features/slayers/index.js | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 8961c41..bb95c63 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -31,6 +31,7 @@ class Slayers extends Feature { this.emanHpElement = new HudTextElement().setToggleSetting(this.emanHpGuiElement).setLocationSetting(new LocationSetting("Eman Hp Location", "Allows you to edit the location of the enderman hp", "eman_location", this, [10, 50, 1, 1]).requires(this.emanHpGuiElement).editTempText("&6Enderman&7> &f&l30 Hits")); this.hudElements.push(this.emanHpElement); + this.hideSummonsForLoot = new ToggleSetting("Hides summons for 3s to see t4 drops", "This will make loots more visible.", false, "show_loot", this); this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); this.slayerXpElement = new HudTextElement() @@ -130,6 +131,7 @@ class Slayers extends Feature { this.todoE2 = []; this.emanBoss = undefined; this.actualEmanBoss = undefined + this.hideSummons = false; this.nextIsBoss = 0; this.counter = 0; this.emanStartedSittingTime = -1 @@ -140,6 +142,8 @@ class Slayers extends Feature { this.entityAttackEventLoaded = false; this.entityAttackEventE = undefined; + this.renderEntityEvent = this.registerEvent("renderEntity", this.renderEntity); + this.renderEntityEvent.unregister(); this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent).registeredWhen(() => this.hasQuest); this.registerEvent("tick", this.tick); @@ -165,11 +169,18 @@ class Slayers extends Feature { this.beaconLocations = {}; this.eyeE = []; this.emanBoss = undefined; - this.actualEmanBoss = undefined + this.actualEmanBoss = undefined; + this.hideSummons = false this.slayerLocationDataH = {} } + renderEntity(entity, pos, partialTicks, event) { + if (entity.getClassName() === "EntityZombie") { + cancel(event) + } + } + entityAttackEvent(event) { if (event.source.func_76346_g() === Player.getPlayer()) { if (event.entity instanceof net.minecraft.entity.monster.EntityEnderman) { @@ -231,6 +242,11 @@ class Slayers extends Feature { } tick() { + if (this.hideSummonsForLoot.getValue() && this.hideSummons) { + this.renderEntityEvent.register(); + } else if (this.hideSummonsForLoot.getValue()) { + this.renderEntityEvent.unregister(); + } if (this.betterHideDeadEntity.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach(name => { if (name.getName().removeFormatting().split(" ")[name.getName().removeFormatting().split(" ").length - 1] === "0❤" || @@ -323,6 +339,9 @@ class Slayers extends Feature { } if (this.emanBoss && this.emanBoss.getEntity()[f.isDead]) { + if (this.hideSummonsForLoot.getValue()) { + setTimeout(() => { this.hideSummons = false }, 2000); + } this.emanBoss = undefined this.actualEmanBoss = undefined } @@ -415,10 +434,12 @@ class Slayers extends Feature { if (this.emanBoss) { let emanText = "&6Enderman&7> " + (this.emanBoss.getName().split("Voidgloom Seraph")[1] || "").trim() - + let emanHealth = ChatLib.removeFormatting(this.emanBoss.getName().split("Voidgloom Seraph")[1]) + //only runs when t4's hp is <= 3m + if (emanHealth.includes("k") || (emanHealth.includes("m") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { + this.hideSummons = true + } if (this.rcmDaeAxeSupport.getValue()) { - let emanHealth = ChatLib.removeFormatting(this.emanBoss.getName().split("Voidgloom Seraph")[1]) - if (emanHealth.includes("k")) { emanText += " &c0 Hits" } else if (emanHealth.includes("M") && parseInt(emanHealth) <= parseFloat(this.whenToShowHitsLeft.getValue())) { @@ -598,6 +619,7 @@ class Slayers extends Feature { this.entityAttackEventLoaded = undefined; this.todoE2 = undefined; this.entityAttackEventE = undefined; + this.hideSummons = false; } onDisable() { -- cgit From 6e53cecbb56b8672a3c81443921c942b4bb68a77 Mon Sep 17 00:00:00 2001 From: jakeQT <96396730+jakeQT@users.noreply.github.com> Date: Sun, 19 Jun 2022 15:51:19 +0800 Subject: added something else than 1st commit + support all enderman bosses (incase 1st one doesnt work) --- features/slayers/index.js | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index bb95c63..cdf6636 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -27,11 +27,12 @@ class Slayers extends Feature { this.boxToEmanBeacon = new ToggleSetting("Box and line to the enderman beacon", "This will help to find the beacon when the boss throws it", true, "eman_beacon", this); this.emanBeaconDinkDonk = new ToggleSetting("DinkDonk when beacon is spawned", "This will help to notice when the beacon is spawned", true, "eman_beacon_dinkdink", this); this.emanEyeThings = new ToggleSetting("Put box around the enderman eye things", "This will help to find them", true, "eman_eye_thing", this); - this.emanHpGuiElement = new ToggleSetting("Render the enderman hp on your screen", "This will help you to know what stage u are in etc.", true, "eman_hp", this); + this.emanHpGuiElement = new ToggleSetting("Render the enderman hp on your screen", "This will help you to know what stage u are in etc.", true, "eman_hp", this).contributor("EmeraldMerchant"); this.emanHpElement = new HudTextElement().setToggleSetting(this.emanHpGuiElement).setLocationSetting(new LocationSetting("Eman Hp Location", "Allows you to edit the location of the enderman hp", "eman_location", this, [10, 50, 1, 1]).requires(this.emanHpGuiElement).editTempText("&6Enderman&7> &f&l30 Hits")); this.hudElements.push(this.emanHpElement); - this.hideSummonsForLoot = new ToggleSetting("Hides summons for 3s to see t4 drops", "This will make loots more visible.", false, "show_loot", this); + this.hideSummonsForLoot = new ToggleSetting("Hides summons for 3s to see t4 drops", "This will make loots more visible.", false, "show_loot", this).contributor("EmeraldMerchant"); + this.allEmanBosses = new ToggleSetting("Hides summons for all eman bosses", "Hides summon for not just your boss, might fix ^ sometimes not working", false, "show_loot_all_bosses", this).requires(this.hideSummonsForLoot).contributor("EmeraldMerchant"); this.slayerXpGuiElement = new ToggleSetting("Render the xp of your current slayer on your screen", "This will help you to know how much xp u have now w/o looking in chat", true, "slayer_xp_hud", this).contributor("EmeraldMerchant"); this.slayerXpElement = new HudTextElement() @@ -430,7 +431,18 @@ class Slayers extends Feature { } return true; }); - + + // just makes it to work on all eman slayers + if (this.allEmanBosses.getValue()) { + World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach(enderman => { + if (!enderman.getName().split(" ").includes("Voidgloom") || enderman.distanceTo(Player.getPlayer()) > 20) return + let emanHealth = ChatLib.removeFormatting(enderman.getName().split("Voidgloom Seraph")[1]) + //only runs when t4's hp is <= 3m + if (emanHealth.includes("k") || (emanHealth.includes("m") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { + this.hideSummons = true + } + }); + } if (this.emanBoss) { let emanText = "&6Enderman&7> " + (this.emanBoss.getName().split("Voidgloom Seraph")[1] || "").trim() -- cgit From 336bb1dc925e102e22be53ea16296aa2caa7a1e6 Mon Sep 17 00:00:00 2001 From: jakeQT <96396730+jakeQT@users.noreply.github.com> Date: Sun, 19 Jun 2022 16:24:42 +0800 Subject: a make it to use delay utils --- features/slayers/index.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index cdf6636..b412461 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -10,6 +10,7 @@ import ToggleSetting from "../settings/settingThings/toggle"; import socketConnection from "../../socketConnection"; import TextSetting from "../settings/settingThings/textSetting"; import { firstLetterCapital } from "../../utils/stringUtils"; +import { delay } from "../../utils/delayUtils"; class Slayers extends Feature { constructor() { @@ -341,7 +342,7 @@ class Slayers extends Feature { if (this.emanBoss && this.emanBoss.getEntity()[f.isDead]) { if (this.hideSummonsForLoot.getValue()) { - setTimeout(() => { this.hideSummons = false }, 2000); + delay(2000, () => { this.hideSummons = false }) } this.emanBoss = undefined this.actualEmanBoss = undefined @@ -431,7 +432,7 @@ class Slayers extends Feature { } return true; }); - + // just makes it to work on all eman slayers if (this.allEmanBosses.getValue()) { World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach(enderman => { -- cgit From aaa8bc2027f7eae1e009b0c27cb549bdbe715061 Mon Sep 17 00:00:00 2001 From: jakeQT <96396730+jakeQT@users.noreply.github.com> Date: Sun, 19 Jun 2022 17:55:21 +0800 Subject: fixes although it still doesnt work properly = just fixes --- features/slayers/index.js | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index b412461..9855148 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -198,7 +198,6 @@ class Slayers extends Feature { } } } - renderWorld(ticks) { if (this.emanBoss && this.boxAroundEmanBoss.getValue()) drawBoxAtEntity(this.emanBoss, 0, 255, 0, 1, -3, ticks, 4, false); @@ -244,6 +243,7 @@ class Slayers extends Feature { } tick() { + let text = "" if (this.hideSummonsForLoot.getValue() && this.hideSummons) { this.renderEntityEvent.register(); } else if (this.hideSummonsForLoot.getValue()) { @@ -309,12 +309,21 @@ class Slayers extends Feature { // console.log(":" + new Item(e[m.getEquipmentInSlot](4)).getNBT().getCompoundTag("tag").getCompoundTag("SkullOwner").getCompoundTag("Properties").getRawNBT().func_150295_c("textures", 10).func_150305_b(0).func_74779_i("Value")) } } - + if (e[m.getCustomNameTag]() && e[m.getCustomNameTag]().includes("Voidgloom Seraph")) { if (Date.now() - this.nextIsBoss < 3000) { this.emanBoss = new Entity(e); this.nextIsBoss = 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 + let emanHealth = ChatLib.removeFormatting(e[m.getCustomNameTag]().split("Voidgloom Seraph")[1]) + //only runs when t4's hp is <= 3m + if (emanHealth.includes("k") || (emanHealth.includes("m") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { + this.hideSummons = true + } + } } if (e instanceof net.minecraft.entity.item.EntityArmorStand && e[m.getCustomNameTag]() && this.blazeTowerDink.getValue()) { @@ -342,6 +351,7 @@ class Slayers extends Feature { if (this.emanBoss && this.emanBoss.getEntity()[f.isDead]) { if (this.hideSummonsForLoot.getValue()) { + this.hideSummons = true delay(2000, () => { this.hideSummons = false }) } this.emanBoss = undefined @@ -433,18 +443,6 @@ class Slayers extends Feature { return true; }); - // just makes it to work on all eman slayers - if (this.allEmanBosses.getValue()) { - World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand).forEach(enderman => { - if (!enderman.getName().split(" ").includes("Voidgloom") || enderman.distanceTo(Player.getPlayer()) > 20) return - let emanHealth = ChatLib.removeFormatting(enderman.getName().split("Voidgloom Seraph")[1]) - //only runs when t4's hp is <= 3m - if (emanHealth.includes("k") || (emanHealth.includes("m") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { - this.hideSummons = true - } - }); - } - if (this.emanBoss) { let emanText = "&6Enderman&7> " + (this.emanBoss.getName().split("Voidgloom Seraph")[1] || "").trim() let emanHealth = ChatLib.removeFormatting(this.emanBoss.getName().split("Voidgloom Seraph")[1]) @@ -466,9 +464,9 @@ class Slayers extends Feature { } } - this.emanHpElement.setText(emanText); + this.emanHpElement.setText(emanText + `\n&r${text}`); } else { - this.emanHpElement.setText(""); + this.emanHpElement.setText("" + `&r${text}`); } if (this.pillerE) { -- cgit From 99e83ad049579f4247904626773f478cbf4e8da1 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Sun, 19 Jun 2022 18:53:42 +0800 Subject: fix that m to M - m + M --- features/slayers/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'features/slayers') diff --git a/features/slayers/index.js b/features/slayers/index.js index 9855148..4135198 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -320,7 +320,7 @@ class Slayers extends Feature { if ((e[f.posX.Entity] - Player.getX()) ** 2 + (e[f.posY.Entity] - Player.getY()) ** 2 + (e[f.posZ.Entity] - Player.getZ()) ** 2 > 20) return let emanHealth = ChatLib.removeFormatting(e[m.getCustomNameTag]().split("Voidgloom Seraph")[1]) //only runs when t4's hp is <= 3m - if (emanHealth.includes("k") || (emanHealth.includes("m") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { + if (emanHealth.includes("k") || (emanHealth.includes("M") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { this.hideSummons = true } } @@ -447,7 +447,7 @@ class Slayers extends Feature { let emanText = "&6Enderman&7> " + (this.emanBoss.getName().split("Voidgloom Seraph")[1] || "").trim() let emanHealth = ChatLib.removeFormatting(this.emanBoss.getName().split("Voidgloom Seraph")[1]) //only runs when t4's hp is <= 3m - if (emanHealth.includes("k") || (emanHealth.includes("m") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { + if (emanHealth.includes("k") || (emanHealth.includes("M") && emanHealth.replace(/[^\d.]/g, "") <= 3)) { this.hideSummons = true } if (this.rcmDaeAxeSupport.getValue()) { -- cgit