diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-06 21:40:49 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-05-06 21:40:49 +0800 |
commit | f0cfad5af93244618d5a60c88b1c0a4837e629ae (patch) | |
tree | 062a301f34c8e6d3284fa845676b23b2ab8d7f9a /features/nether/index.js | |
parent | e2e2d676ee056e9f44f6c67e29f0952b9ef956b2 (diff) | |
download | SoopyV2-f0cfad5af93244618d5a60c88b1c0a4837e629ae.tar.gz SoopyV2-f0cfad5af93244618d5a60c88b1c0a4837e629ae.tar.bz2 SoopyV2-f0cfad5af93244618d5a60c88b1c0a4837e629ae.zip |
+ Many performance improvements
+ Fix rescue mission waypoints
Diffstat (limited to 'features/nether/index.js')
-rw-r--r-- | features/nether/index.js | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/features/nether/index.js b/features/nether/index.js index 26ab29a..ee75c35 100644 --- a/features/nether/index.js +++ b/features/nether/index.js @@ -28,6 +28,16 @@ class Nether extends Feature { super(); } + isInDojo() { + if (!this.FeatureManager || !this.FeatureManager.features["dataLoader"]) return false + return this.FeatureManager.features["dataLoader"].class.areaFine === "Dojo" || this.FeatureManager.features["dataLoader"].class.areaFine === "Dojo Arena" + } + + isInNether() { + if (!this.FeatureManager || !this.FeatureManager.features["dataLoader"]) return false + return this.FeatureManager.features["dataLoader"].class.area === "Crimson Isle" + } + onEnable() { this.initVariables(); @@ -35,12 +45,11 @@ class Nether extends Feature { this.speedNextBlock = new ToggleSetting("Show next block to stand on for dojo swiftness", "", true, "dojo_swiftness", this) this.tenacityLine = new ToggleSetting("Show line for fireball in dojo tenacity", "This may help you to dodge the fireballs", false, "dojo_tanacity", this) - this.registerCustom("packetReceived", this.packetReceived) - - this.registerStep(true, 1, this.step1S) - this.registerEvent("renderWorld", this.renderWorld) + this.registerCustom("packetReceived", this.packetReceived).registeredWhen(() => this.isInDojo()) + this.registerStep(true, 1, this.step1S).registeredWhen(() => this.isInDojo()) + this.registerEvent("renderWorld", this.renderWorld).registeredWhen(() => this.isInNether()) - this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent); + this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent).registeredWhen(() => this.isInDojo()); this.registerEvent("tick", this.tick) this.todoE = [] @@ -61,12 +70,6 @@ class Nether extends Feature { this.inSwiftness = false this.lastBlock = undefined }) - //&e[NPC] &eRescue Recruiter&f: &rPerfect! Go see our &eUndercover Agent &rat the &5Cathedral &rarea in &5Mage &rterritory to get started.&r - this.registerChat("&e[NPC] &eRescue Recruiter&f: &rPerfect! Go see our &eUndercover Agent &rat the ${*} in ${type} &rterritory to get started.&r", (type) => { - // console.log(type) - this.rescueMissionType = ChatLib.removeFormatting(type) === "Mage" ? "barbarian" : "mage" - // console.log(this.rescueMissionDifficulty, this.rescueMissionType) - }) this.registerChat("You completed your rescue quest! Visit the Town Board to claim the rewards,", () => { this.rescueMissionDifficulty = this.rescueMissionType = undefined @@ -77,13 +80,18 @@ class Nether extends Feature { } tick() { - if (Player.getContainer().getName() === "Rescue") { + if (Player.getContainer().getName() === "Rescue" && Player.getContainer().getStackInSlot(22)) { let difficulty = ChatLib.removeFormatting(Player.getContainer().getStackInSlot(22).getName()).trim()[0] this.rescueMissionDifficulty = difficulty - // console.log(this.rescueMissionDifficulty, this.rescueMissionType) + TabList.getNames().forEach(n => { + if (n.toLowerCase().includes("barbarian rep")) this.rescueMissionType = "barbarian"// : "mage" + if (n.toLowerCase().includes("mage rep")) this.rescueMissionType = "mage"// : "mage" + }) } + + this.todoE2.forEach(e => { let item = e[m.getHeldItem]() if (!item) return |