diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-11 21:12:50 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-09-11 21:12:50 +0800 |
commit | 8e7d6d4a6be5af3b377ff179d0d074ac5351ada0 (patch) | |
tree | ff0e5b034b8417418b3c77d8f0fdbff608e799be /features | |
parent | 0dd404208fc066dcb3f826c7c2f558a9bcc27725 (diff) | |
parent | 0275a74eb6c13203f7726de0afe87b31784420af (diff) | |
download | SoopyV2-8e7d6d4a6be5af3b377ff179d0d074ac5351ada0.tar.gz SoopyV2-8e7d6d4a6be5af3b377ff179d0d074ac5351ada0.tar.bz2 SoopyV2-8e7d6d4a6be5af3b377ff179d0d074ac5351ada0.zip |
Merge branch 'master' of https://github.com/Soopyboo32/SoopyV2
Diffstat (limited to 'features')
-rw-r--r-- | features/events/index.js | 2 | ||||
-rw-r--r-- | features/nether/index.js | 62 | ||||
-rw-r--r-- | features/slayers/index.js | 6 |
3 files changed, 64 insertions, 6 deletions
diff --git a/features/events/index.js b/features/events/index.js index 511295a..8c18c04 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -346,7 +346,7 @@ class Events extends Feature { this.hasWarps.forEach(w => { if (!warpData[w]) return - let d = calculateDistance(warpData[w], this.guessPoint) + let d = calculateDistance(warpData[w], this.guessPoint2) if (d < minDist) { warp = "warp " + w minDist = d diff --git a/features/nether/index.js b/features/nether/index.js index ec2ef08..49388bd 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -5,6 +5,8 @@ import Feature from "../../featureClass/class"; import socketConnection from "../../socketConnection"; import { drawBoxAtBlock, drawBoxAtBlockNotVisThruWalls, drawBoxAtEntity, drawCoolWaypoint, drawLine, drawLineWithDepth, renderBeaconBeam } from "../../utils/renderUtils"; import ToggleSetting from "../settings/settingThings/toggle"; +import HudTextElement from "../hud/HudTextElement"; +import LocationSetting from "../settings/settingThings/location"; const MCBlock = Java.type("net.minecraft.block.Block"); const ArmorStand = Java.type("net.minecraft.entity.item.EntityArmorStand") const MCItem = Java.type("net.minecraft.item.Item"); @@ -58,12 +60,23 @@ class Nether extends Feature { this.hostageWaypoints = new ToggleSetting("Show hostage waypoints", "Waypoint for location of hostage in rescue missions", true, "hostage_waypoint", this) this.slugfishTimer = new ToggleSetting("Show timer over rod", "This may help with fishing slugfish", false, "slugfish_timer", this) + this.minibossNametag = new ToggleSetting("Nether Miniboss Nametag Hud", "renders the HP of minibosses on screen (exclude Magma Boss)", false, "nether_mini_nametag_hud", this); + this.minibossNametagElement = new HudTextElement() + .setText("") + .setToggleSetting(this.minibossNametag) + .setLocationSetting(new LocationSetting("Nether Miniboss Nametag Hud location", "allows you to change the location of the hud", "nether_mini_nametag_hud_location", this, [10, 100, 1, 1]).requires(this.minibossNametag).editTempText("&5&lMage Outlaw &r&a70M&c❤")); + this.hudElements.push(this.minibossNametagElement); + + this.registerStep(true, 5, this.minibossHPHud) + this.todoE = [] this.todoE2 = [] this.blocks = [] this.todoF = [] this.todoF2 = [] + this.todoM = [] + this.todoM2 = [] this.disciplineZombies = { "Wood": [], "Iron": [], @@ -96,7 +109,7 @@ class Nether extends Feature { this.registerStep(true, 1, this.step1S).registeredWhen(() => this.isInNether()) this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.isInNether()) - this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent).registeredWhen(() => this.isInDojo()); + this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent).registeredWhen(() => this.isInDojo() || (this.isInNether() && this.minibossNametag.getValue())); this.registerEvent("tick", this.tick).registeredWhen(() => this.isInNether()) this.registerChat("&r&r&r &r&aTest of Swiftness &r&e&lOBJECTIVES&r", () => { if (this.speedNextBlock.getValue()) { @@ -201,6 +214,18 @@ class Nether extends Feature { this.controlLocLast = undefined this.controlLoc = undefined } + + this.todoM2.forEach(e => { + let name = e[m.getCustomNameTag]() + if (name) { + if (name.includes("Ashfang") || name.includes("Barbarian Duke X") || name.includes("Bladesoul") || name.includes("Mage Outlaw")) { + this.miniboss = new Entity(e) + } + } + }) + + this.todoM2 = this.todoM + this.todoM = [] } entityJoinWorldEvent(event) { @@ -208,6 +233,9 @@ class Nether extends Feature { if (this.disciplineOverlay.getValue() && this.inDiscipline && event.entity instanceof ArmorStand) this.todoF.push(new Entity(event.entity)) if (event.entity instanceof EntitySkeleton && !this.controlSkeleton) this.controlSkeleton = new Entity(event.entity) + if (this.minibossNametag.getValue() && event.entity instanceof ArmorStand) { + this.todoM.push(event.entity) + } } packetReceived(packet, event) { @@ -324,10 +352,40 @@ class Nether extends Feature { return MCBlock[m.getStateId](state) } + minibossHPHud() { + if (this.miniboss && this.miniboss.getEntity()[f.isDead]) this.miniboss = undefined + if (!this.minibossNametag.getValue() || !this.miniboss) { + this.minibossNametagElement.setText("") + return + } + let name = this.miniboss.getName() + let nameRemoveFormat = name.removeFormatting() + let mobName = "" + if (nameRemoveFormat.includes("Ashfang")) mobName = "&dAshfang" + if (nameRemoveFormat.includes("Bladesoul")) mobName = "&dBladesoul" + if (nameRemoveFormat.includes("Barbarian Duke X")) mobName = "&dBarbarian Duke X" + if (nameRemoveFormat.includes("Mage Outlaw")) mobName = "&dMage Outlaw" + if (!mobName) { + this.minibossNametagElement.setText("") + return + } + let indexOfHP = { + "&dAshfang": 3, + "&dBladesoul": 3, + "&dBarbarian Duke X": 5, + "&dMage Outlaw": 4 + } + let HP = `&l${mobName} &r${name.split(" ")[indexOfHP[mobName]].split("/")[0]}&c❤` + this.minibossNametagElement.setText(HP) + } + initVariables() { + this.hudElements = []; + this.miniboss = undefined } onDisable() { + this.hudElements.forEach(h => h.delete()) this.initVariables(); } } @@ -344,4 +402,4 @@ function getField(e, field) { field2.setAccessible(true) return field2.get(e) -}
\ No newline at end of file +} diff --git a/features/slayers/index.js b/features/slayers/index.js index 590c5b6..2d8e1fa 100644 --- a/features/slayers/index.js +++ b/features/slayers/index.js @@ -531,7 +531,7 @@ class Slayers extends Feature { this.cannotFindEmanBoss = false } else if (nameRemoveFormat.includes("Voidgloom Seraph") && ((name.getX() - Player.getX()) ** 2 + (name.getY() - Player.getY()) ** 2 + (name.getZ() - Player.getZ()) ** 2 < 25)) { this.emanBoss = name - assignActualEmanBoss(this.emanBoss) + this.assignActualEmanBoss(this.emanBoss) this.cannotFindEmanBoss = false } } @@ -622,12 +622,12 @@ class Slayers extends Feature { if (e[m.getCustomNameTag]() && e[m.getCustomNameTag]().includes("Voidgloom Seraph")) { if (Date.now() - this.nextIsBoss < 3000) { this.emanBoss = new Entity(e); - assignActualEmanBoss(this.emanBoss) + this.assignActualEmanBoss(this.emanBoss) 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); - assignActualEmanBoss(this.emanBoss) + this.assignActualEmanBoss(this.emanBoss) this.cannotFindEmanBoss = false } |