aboutsummaryrefslogtreecommitdiff
path: root/features/nether
diff options
context:
space:
mode:
Diffstat (limited to 'features/nether')
-rw-r--r--features/nether/index.js34
-rw-r--r--features/nether/metadata.json4
2 files changed, 23 insertions, 15 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
diff --git a/features/nether/metadata.json b/features/nether/metadata.json
index 8b8a989..687abd6 100644
--- a/features/nether/metadata.json
+++ b/features/nether/metadata.json
@@ -1,8 +1,8 @@
{
"name": "Nether",
- "description": "May cause some lag if enabled when not in nether",
+ "description": "",
"isHidden": false,
"isTogglable": true,
- "defaultEnabled": false,
+ "defaultEnabled": true,
"sortA": 1
} \ No newline at end of file