From 8e3b9a4efcd4fc1a4df086def79d58efe5b77ced Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 09:16:17 +0800 Subject: finished todo + resetminingdata() scatha todo --- features/specialMining/index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/specialMining/index.js b/features/specialMining/index.js index 794b9ca..5537097 100644 --- a/features/specialMining/index.js +++ b/features/specialMining/index.js @@ -240,7 +240,7 @@ class PowderAndScatha extends Feature { Object.keys(this.miningData.powder).forEach(thing => this.miningData.powder[thing] = 0) this.expRateInfo = [] } else if (type === "scatha") { - //TODO + Object.keys(this.miningData.scatha).forEach(thing => this.miningData.scatha[thing] = 0) } } -- cgit From eec8fc1fe02924fd56a613f2aba99a485bbd0321 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:32:17 +0800 Subject: +worm/scatha hp hud element --- features/specialMining/index.js | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/features/specialMining/index.js b/features/specialMining/index.js index 5537097..d58a978 100644 --- a/features/specialMining/index.js +++ b/features/specialMining/index.js @@ -8,6 +8,7 @@ import { delay } from "../../utils/delayUtils"; import TextSetting from "../settings/settingThings/textSetting"; import { drawBoxAtBlock, drawFilledBox } from "../../utils/renderUtils"; import RenderLib2D from "../../utils/renderLib2d"; +import { f, m } from "../../../mappings/mappings"; class PowderAndScatha extends Feature { constructor() { @@ -195,6 +196,14 @@ class PowderAndScatha extends Feature { .setToggleSetting(this.scathaCounter) .setLocationSetting(new LocationSetting("Scatha Counter Hud Location", "Allows you to edit the location of Scatha Counter Hud", "scatha_mining_hud_location", this, [10, 50, 1, 1]).requires(this.scathaCounter).editTempText(`&6Scatha Counter\n&bKills: 1,000\n&bWorms: 800\n&bScathas: 200\n&bSince Scatha: 10\n&9Rare Scatha Pets: 5\n&5Epic Scatha Pets: 3\n&6Leg Scatha Pets: 1\n&bSince Pet: 20`)); this.hudElements.push(this.scathaCounterElement); + + this.wormEntity = undefined; + this.scathaHealth = new ToggleSetting("Scatha Health Hud", "This will show worm/scatha mob HP on screen", false, "scatha_hp_hud", this).requires(this.scathaMain).contributor("EmeraldMerchant"); + this.scathaHealthElement = new HudTextElement() + .setText("") + .setToggleSetting(this.scathaHealth) + .setLocationSetting(new LocationSetting("Scatha Health Hud Location", "Allows you to edit the location of Scatha Health Hud", "scatha_hp_hud_location", this, [10, 50, 1, 1]).requires(this.scathaHealth).editTempText(`&8[&7Lv5&8] &cWorm &e5&c❤`)); + this.hudElements.push(this.scathaHealthElement); new SettingBase("/scathaset ", "This command will change values in the counter", undefined, "scatha_cmd", this).requires(this.scathaMain); new SettingBase("/ss works too", "you can press TAB for auto-complete", undefined, "scatha_cmd2", this).requires(this.scathaMain); @@ -221,6 +230,7 @@ class PowderAndScatha extends Feature { this.registerStep(true, 2, this.step2fps); this.registerStep(true, 3, this.wormStep); + this.registerStep(true, 5, this.scathaHP); } spawnParticle(particle, type, event) { @@ -325,6 +335,11 @@ class PowderAndScatha extends Feature { if (this.miningData.scatha.rare + this.miningData.scatha.epic + this.miningData.scatha.legandary > 0) tempText += `&bSince Pet: ${this.miningData.scatha.since_pet}` this.scathaCounterElement.setText(tempText) } + World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand)?.forEach(e => { + if (e.getName().includes("Brood Mother")) { + Client.showTitle("&cBROODMOTHER", "", 1, 5, 1); + }; + }); } compactPowderChat() { @@ -388,6 +403,7 @@ class PowderAndScatha extends Feature { this.miningData.scatha.since_scatha++; this.saveMiningData() this.wormSpawned = false; + if (this.scathaHealth.getValue()) this.wormEntity = entity } if (name.startsWith("§8[§7Lv10§8] §cScatha")) { if (this.wormSpawnedChatMessage.getValue()) ChatLib.chat("&c&lScatha Spawned."); @@ -398,16 +414,26 @@ class PowderAndScatha extends Feature { this.miningData.scatha.since_scatha = 0 this.saveMiningData() this.wormSpawned = false; + if (this.scathaHealth.getValue()) this.wormEntity = entity } }); } + scathaHP() { + let tempText = "" + if (!this.wormEntity || !this.scathaHealth.getValue()) return + if (this.wormEntity.getEntity()[f.isDead]) this.wormEntity = undefined; + tempText = this.wormEntity.getName() + this.scathaHealthElement.setText(tempText) + } + initVariables() { this.hudElements = []; this.inCrystalHollows = false; this.foundWither = true; this.dPowder = 0; this.wormSpawned = false; + this.wormEntity = undefined; } onDisable() { -- cgit From 1fedf1d7bdd28920bb9fe5862aa55fa6b7df7a53 Mon Sep 17 00:00:00 2001 From: EmeraldMerchant <96396730+EmeraldMerchant@users.noreply.github.com> Date: Tue, 6 Sep 2022 10:54:28 +0800 Subject: bug fix - something irrelevant (def not extra mob alert, oops) = fixed scatha health hud logic --- features/specialMining/index.js | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/features/specialMining/index.js b/features/specialMining/index.js index d58a978..0da808d 100644 --- a/features/specialMining/index.js +++ b/features/specialMining/index.js @@ -196,7 +196,7 @@ class PowderAndScatha extends Feature { .setToggleSetting(this.scathaCounter) .setLocationSetting(new LocationSetting("Scatha Counter Hud Location", "Allows you to edit the location of Scatha Counter Hud", "scatha_mining_hud_location", this, [10, 50, 1, 1]).requires(this.scathaCounter).editTempText(`&6Scatha Counter\n&bKills: 1,000\n&bWorms: 800\n&bScathas: 200\n&bSince Scatha: 10\n&9Rare Scatha Pets: 5\n&5Epic Scatha Pets: 3\n&6Leg Scatha Pets: 1\n&bSince Pet: 20`)); this.hudElements.push(this.scathaCounterElement); - + this.wormEntity = undefined; this.scathaHealth = new ToggleSetting("Scatha Health Hud", "This will show worm/scatha mob HP on screen", false, "scatha_hp_hud", this).requires(this.scathaMain).contributor("EmeraldMerchant"); this.scathaHealthElement = new HudTextElement() @@ -335,11 +335,6 @@ class PowderAndScatha extends Feature { if (this.miningData.scatha.rare + this.miningData.scatha.epic + this.miningData.scatha.legandary > 0) tempText += `&bSince Pet: ${this.miningData.scatha.since_pet}` this.scathaCounterElement.setText(tempText) } - World.getAllEntitiesOfType(net.minecraft.entity.item.EntityArmorStand)?.forEach(e => { - if (e.getName().includes("Brood Mother")) { - Client.showTitle("&cBROODMOTHER", "", 1, 5, 1); - }; - }); } compactPowderChat() { @@ -397,7 +392,7 @@ class PowderAndScatha extends Feature { //§8[§7Lv5§8] §cWorm§r §e5§c❤ if (name.startsWith("§8[§7Lv5§8] §cWorm")) { if (this.wormSpawnedChatMessage.getValue()) ChatLib.chat("&c&lWorm Spawned. (Since Scatha: " + (this.miningData.scatha.since_scatha + 1) + ")"); - if (this.wormSpawnedWarn.getValue()) Client.showTitle("&c&lWorm Spawned.", "", 0, 20, 10); + if (this.wormSpawnedWarn.getValue()) Client.showTitle("&c&lWorm Spawned!", "", 0, 20, 10); this.miningData.scatha.total_worms++; this.miningData.scatha.worms++; this.miningData.scatha.since_scatha++; @@ -407,7 +402,7 @@ class PowderAndScatha extends Feature { } if (name.startsWith("§8[§7Lv10§8] §cScatha")) { if (this.wormSpawnedChatMessage.getValue()) ChatLib.chat("&c&lScatha Spawned."); - if (this.wormSpawnedWarn.getValue()) Client.showTitle("&c&lScatha Spawned.", "", 0, 20, 10); + if (this.wormSpawnedWarn.getValue()) Client.showTitle("&c&lScatha Spawned!", "", 0, 20, 10); this.miningData.scatha.total_worms++; this.miningData.scatha.scathas++; this.miningData.scatha.since_pet++; @@ -421,8 +416,13 @@ class PowderAndScatha extends Feature { scathaHP() { let tempText = "" - if (!this.wormEntity || !this.scathaHealth.getValue()) return - if (this.wormEntity.getEntity()[f.isDead]) this.wormEntity = undefined; + if (this.scathaHealth.getValue()) { + if (this.wormEntity && this.wormEntity.getEntity()[f.isDead]) { + this.wormEntity = undefined; + } + } else if (this.wormEntity) { + this.wormEntity = undefined; + } tempText = this.wormEntity.getName() this.scathaHealthElement.setText(tempText) } -- cgit