diff options
-rw-r--r-- | features/events/index.js | 25 | ||||
-rw-r--r-- | metadata.json | 4 |
2 files changed, 16 insertions, 13 deletions
diff --git a/features/events/index.js b/features/events/index.js index c315955..309a788 100644 --- a/features/events/index.js +++ b/features/events/index.js @@ -48,6 +48,7 @@ class Events extends Feature { this.dingIndex = 0 this.slayerLocationDataH = {} + this.todoE = [] this.shinyBlockOverlayEnabled = new ToggleSetting("Shiny blocks highlight", "Will highlight shiny blocks in the end", false, "shiny_blocks_overlay", this) @@ -58,21 +59,15 @@ class Events extends Feature { this.registerStep(false, 5, this.step_5s) this.registerEvent("soundPlay", this.playSound).registeredWhen(() => this.showingWaypoints) + this.registerForge(net.minecraftforge.event.entity.EntityJoinWorldEvent, this.entityJoinWorldEvent).registeredWhen(() => this.showingWaypoints); this.registerChat("&r&eYou dug out a Griffin Burrow! &r&7(${*}/4)&r", this.burrialClicked) this.registerChat("&r&eYou finished the Griffin burrow chain! &r&7(4/4)&r", this.burrialClicked) this.inquisWaypointSpawned = false - this.registerChat("${a}You dug out a ${thing}!", (a, thing) => { - console.log(a, thing) - if (a.includes(":") || a.length === 0 || a.length > 50) return - if (!thing.toLowerCase().includes("inquis")) return - this.inquisWaypointSpawned = true - socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); - }) - this.registerCommand("fakeinquis", () => { - this.inquisWaypointSpawned = true - socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); - }) + } + + entityJoinWorldEvent(e) { + this.todoE.push(e.entity); } inquisData(loc, user) { @@ -190,6 +185,14 @@ class Events extends Feature { delete this.slayerLocationDataH[n] } }) + + this.todoE.forEach(e => { + e = new Entity(e) + if (e.getName().toLowerCase().includes("inquis") && Math.abs(e.getY() - Player.getY()) < 10 && Math.abs(e.getX() - Player.getX()) < 10 && Math.abs(e.getZ() - Player.getZ()) < 10) { + socketConnection.sendInquisData({ loc: [Math.round(Player.getX()), Math.round(Player.getY()), Math.round(Player.getZ())] }); + } + }) + this.todoE = [] } step_5s() { diff --git a/metadata.json b/metadata.json index 797bfe8..99bd72a 100644 --- a/metadata.json +++ b/metadata.json @@ -5,8 +5,8 @@ "entry": "index.js", "description": "SoopyV2", "name": "SoopyV2", - "version": "2.1.68", - "versionId": 195, + "version": "2.1.69", + "versionId": 196, "requires": [ "soopyApis", "soopyAddonsData", |