diff options
author | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-07-14 18:17:53 +0800 |
---|---|---|
committer | Soopyboo32 <49228220+Soopyboo32@users.noreply.github.com> | 2022-07-14 18:17:53 +0800 |
commit | 9ffe3b2c22e30974087d4812bc757155f09d6e57 (patch) | |
tree | 3af726747089775e4f6da2b2f0b1d9f8b612d8aa /features/dungeonRoutes | |
parent | 598dadc9efadf69401f08d27e5b0ff1b36a0f2bc (diff) | |
download | SoopyV2-9ffe3b2c22e30974087d4812bc757155f09d6e57.tar.gz SoopyV2-9ffe3b2c22e30974087d4812bc757155f09d6e57.tar.bz2 SoopyV2-9ffe3b2c22e30974087d4812bc757155f09d6e57.zip |
+ Update website url
Diffstat (limited to 'features/dungeonRoutes')
-rw-r--r-- | features/dungeonRoutes/index.js | 71 | ||||
-rw-r--r-- | features/dungeonRoutes/routesData.json | 1299 |
2 files changed, 1159 insertions, 211 deletions
diff --git a/features/dungeonRoutes/index.js b/features/dungeonRoutes/index.js index a7d8691..3eb50c3 100644 --- a/features/dungeonRoutes/index.js +++ b/features/dungeonRoutes/index.js @@ -3,6 +3,7 @@ import { m } from "../../../mappings/mappings"; import Feature from "../../featureClass/class"; import { drawBoxAtBlock, drawBoxAtBlock2, drawFilledBox, drawLine, drawLinePoints } from "../../utils/renderUtils"; +import { calculateDistanceQuick } from "../../utils/utils"; import SettingBase from "../settings/settingThings/settingBase"; const EntityItem = Java.type("net.minecraft.entity.item.EntityItem") @@ -70,7 +71,8 @@ class DungeonRoutes extends Feature { this.recordingData[this.recordingData.length - 1].tnts.forEach((loc) => { drawFilledBox(loc[0], loc[1] - 0.5, loc[2], 1, 1, 1, 0, 0, 50 / 255, true) }) - this.recordingData[this.recordingData.length - 1].interacts.forEach(({ loc }) => { + this.recordingData[this.recordingData.length - 1].interacts.forEach((data) => { + let loc = data.loc drawFilledBox(loc[0], loc[1], loc[2], 1, 1, 0, 0, 1, 50 / 255, true) drawBoxAtBlock(loc[0] - 0.5, loc[1], loc[2] - 0.5, 0, 0, 1, 1, 1, 1) }) @@ -79,7 +81,6 @@ class DungeonRoutes extends Feature { } if (this.currRoomData) { - drawBoxAtBlock(...this.toRoomCoordinates(0, 70, 0), 1, 0, 0, 1, 1, 1) if (this.currentRouteDisplay) { this.currentRouteDisplay[this.currentActionIndex].etherwarps.forEach(loc => { let coords = this.toRoomCoordinates(loc[0], loc[1] - 1, loc[2]) @@ -87,17 +88,17 @@ class DungeonRoutes extends Feature { drawBoxAtBlock(coords[0] - 0.5, coords[1], coords[2] - 0.5, 1, 0, 0, 1, 1, 1) }) this.currentRouteDisplay[this.currentActionIndex].mines.forEach(loc => { - let coords = this.toRoomCoordinates(loc[0], loc[1] - 1, loc[2]) - drawFilledBox(coords[0], coords[1] + 0.5, coords[2], 1, 1, 0, 255, 0, 50 / 255, true) + let coords = this.toRoomCoordinates(loc[0], loc[1] - 0.5, loc[2]) + drawBoxAtBlock(coords[0] - 0.5, coords[1], coords[2] - 0.5, 1, 1, 0, 1, 1, 50 / 255) }) this.currentRouteDisplay[this.currentActionIndex].tnts.forEach(loc => { let coords = this.toRoomCoordinates(loc[0], loc[1] - 1, loc[2]) - drawFilledBox(coords[0], coords[1] + 0.5, coords[2] + 0.5, 1, 1, 255, 0, 0, 50 / 255, true) + drawBoxAtBlock(coords[0] - 0.5, coords[1] + 0.5, coords[2] - 0.5, 1, 1, 255, 1, 1, 50 / 255) }) this.currentRouteDisplay[this.currentActionIndex].interacts.forEach((data) => { let coords = this.toRoomCoordinates(data.loc[0], data.loc[1], data.loc[2]) drawFilledBox(coords[0], coords[1], coords[2], 1, 1, 0, 0, 1, 50 / 255, true) - drawBoxAtBlock(coords[0], coords[1], coords[2], 0, 0, 1, 1, 1, 1) + drawBoxAtBlock(coords[0] - 0.5, coords[1], coords[2] - 0.5, 0, 0, 1, 1, 1, 1) }) // if (this.currentRouteDisplay.locations.length >= 2) drawLinePoints(this.currentRouteDisplay.locations.map(a => this.toRoomCoordinates(...a)).map(a => [a[0] - 0.5, a[1] + 0.1, a[2] - 0.5]), 0, 0, 255, 2, false) @@ -144,14 +145,14 @@ class DungeonRoutes extends Feature { let data = { index: this.fullRoomData[this.idMap.get(this.lastRoomId)].index, data: this.recordingData.map(a => { - a.etherwarps = a.etherwarps.map(a => this.fromRoomCoordinates(a[0] + 0.5, a[1], a[2] + 0.5)) - a.mines = a.mines.map(a => this.fromRoomCoordinates(a[0] + 0.5, a[1], a[2] + 0.5)) + a.etherwarps = a.etherwarps.map(a => this.fromRoomCoordinates(a[0], a[1], a[2])) + a.mines = a.mines.map(a => this.fromRoomCoordinates(a[0], a[1], a[2])) a.locations = a.locations.map(a => this.fromRoomCoordinates(...a)) a.interacts = a.interacts.map(b => { - b.pos = this.fromRoomCoordinates(...b.pos) + b.loc = this.fromRoomCoordinates(...b.loc) return b }) - a.tnts = a.tnts.map(a => this.fromRoomCoordinates(a[0] + 0.5, a[1], a[2] + 0.5)) + a.tnts = a.tnts.map(a => this.fromRoomCoordinates(a[0], a[1], a[2])) return a }) @@ -172,24 +173,6 @@ class DungeonRoutes extends Feature { this.registerStep(true, 5, () => { if (this.currRoomData) { if (this.currentRouteDisplay) { - // this.currentRouteDisplay.etherwarps.forEach(loc => { - // let coords = this.toRoomCoordinates(loc[0], loc[1] - 1, loc[2]) - // drawFilledBox(coords[0] + 0.5, coords[1], coords[2] + 0.5, 1, 1, 1, 0, 0, 50 / 255, true) - // drawBoxAtBlock(coords[0], coords[1], coords[2], 1, 0, 0, 1, 1, 1) - // }) - // this.currentRouteDisplay.mines.forEach(loc => { - // let coords = this.toRoomCoordinates(loc[0], loc[1] - 1, loc[2]) - // drawFilledBox(coords[0] + 0.5, coords[1] + 0.5, coords[2] + 0.5, 1, 1, 0, 255, 0, 50 / 255, true) - // }) - // this.currentRouteDisplay.tnts.forEach(loc => { - // let coords = this.toRoomCoordinates(loc[0], loc[1] - 1, loc[2]) - // drawFilledBox(coords[0] + 0.5, coords[1] + 0.5, coords[2] + 0.5, 1, 1, 255, 0, 0, 50 / 255, true) - // }) - // this.currentRouteDisplay.interacts.forEach(loc => { - // let coords = this.toRoomCoordinates(loc[0], loc[1], loc[2]) - // drawFilledBox(coords[0] + 0.5, coords[1], coords[2] + 0.5, 1, 1, 0, 0, 1, 50 / 255, true) - // drawBoxAtBlock(coords[0], coords[1], coords[2], 0, 0, 1, 1, 1, 1) - // }) if (this.currentRouteDisplay[this.currentActionIndex].locations.length >= 2) this.drawLineMultipleParticles(this.currentRouteDisplay[this.currentActionIndex].locations.map(a => this.toRoomCoordinates(a[0], a[1], a[2]))) @@ -202,7 +185,7 @@ class DungeonRoutes extends Feature { if (type) { this.recordingData[this.recordingData.length - 1][type].push(point) } - if (!type || type === "interact") { + if (!type || type === "interacts") { this.recordingData.push({ etherwarps: [], mines: [], @@ -411,7 +394,7 @@ class DungeonRoutes extends Feature { if (event.entity instanceof EntityItem) { // console.log("Blaze joined world") let e = new Entity(event.entity) - let pos = { x: e.getX(), y: e.getY(), z: e.getZ() } + let pos = [e.getX(), e.getY(), e.getZ()] this.tempItemIdLocs.set(event.entity[m.getEntityId.Entity](), pos) // console.log(event.entity[m.getEntityId.Entity]()) @@ -419,24 +402,46 @@ class DungeonRoutes extends Feature { } pickupItem(packet) { - if (!this.recordRoute) return let packetType = new String(packet.class.getSimpleName()).valueOf() if (packetType === "S0DPacketCollectItem") { let pos = this.tempItemIdLocs.get(packet[m.getCollectedItemEntityID]()) + let data = this.currentRouteDisplay[this.currentActionIndex].interacts[0] + if (data && data.type === "item") { + let coords = this.toRoomCoordinates(data.loc[0], data.loc[1], data.loc[2]) + if (calculateDistanceQuick(pos, coords) < 2) { + if (this.currentRouteDisplay.length >= this.currentActionIndex) { + this.currentActionIndex++ + } + } + } + + if (!this.recordRoute) return if (pos) this.addRecordingPoint("interacts", { loc: pos, type: "item" }) } } playerInteract(action, position, event) { - if (!this.recordRoute) return if (action.toString() !== "RIGHT_CLICK_BLOCK") return - let pos = { x: Player.lookingAt().getX() + 0.5, y: Player.lookingAt().getY(), z: Player.lookingAt().getZ() + 0.5 } + let pos = [Player.lookingAt().getX() + 0.5, Player.lookingAt().getY(), Player.lookingAt().getZ() + 0.5] let id = Player.lookingAt().getType().getID() if (id !== 54 && id !== 144 && id !== 69) return + + let data = this.currentRouteDisplay[this.currentActionIndex].interacts[0] + if (data && data.type === "interact") { + let coords = this.toRoomCoordinates(data.loc[0], data.loc[1], data.loc[2]) + console.log(coords.join(","), pos.join(",")) + if (coords.join(",") === pos.join(",")) { + if (this.currentRouteDisplay.length > this.currentActionIndex) { + this.currentActionIndex++ + } + } + } + + if (!this.recordRoute) return this.addRecordingPoint("interacts", { loc: pos, type: "interact" }) } diff --git a/features/dungeonRoutes/routesData.json b/features/dungeonRoutes/routesData.json index ed64acf..d701fc7 100644 --- a/features/dungeonRoutes/routesData.json +++ b/features/dungeonRoutes/routesData.json @@ -1,350 +1,1293 @@ [ { - "index": 86, + "index": 84, "data": [ { "etherwarps": [ [ - 10.5, - 82, - -20.5 + 23.5, + 83, + 12.5 + ] + ], + "mines": [], + "locations": [ + [ + -4, + 68, + 16 ], [ - 8.5, - 82, - 19.5 + 23, + 83, + 13 ], [ - 12.5, - 93, - 21.5 + 24, + 84, + 13 + ], + [ + 24, + 85, + 13 + ], + [ + 25, + 85, + 13 + ], + [ + 25, + 84, + 12 + ], + [ + 25, + 84, + 11 + ], + [ + 26, + 84, + 11 + ], + [ + 27, + 84, + 9 + ], + [ + 26, + 84, + 6 + ], + [ + 23, + 84, + 5 + ], + [ + 19, + 84, + 5 + ], + [ + 19, + 85, + 5 + ] + ], + "interacts": [ + { + "loc": [ + 17.5, + 84, + 5.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [ + [ + -1.5, + 85, + 23.5 ] ], "mines": [ [ - 4.5, - 82.5, - -19.5 + -2.5, + 84.5, + 23.5 ] ], "locations": [ [ - 18, - 69, - -25 + 19, + 85, + 5 ], [ - 16, - 69, - -24 + 21, + 85, + 5 ], [ - 15, - 69, - -24 + 22, + 84, + 5 ], [ - 14, - 69, - -24 + 25, + 84, + 7 ], [ - 14, - 67, - -24 + 26, + 84, + 10 ], [ - 14, - 64, - -24 + 25, + 84, + 13 ], [ - 14, - 61, - -24 + 24, + 85, + 13 ], [ - 11, - 82, - -20 + 24, + 84, + 14 ], [ - 10, - 82, - -20 + 23, + 83, + 14 ], [ - 9, - 82, - -20 + -2, + 85, + 24 ], [ - 8, - 82, - -19 + -2, + 84, + 24 ], [ - 7, - 82, - -19 + -3, + 84, + 24 ], [ - 6, - 82, - -19 + -6, + 84, + 24 ], [ - 6, + -8, 83, - -19 + 24 ], [ - 5, + -8, + 81, + 24 + ], + [ + -8, + 84, + 24 + ], + [ + -11, + 83, + 24 + ], + [ + -15, + 83, + 24 + ], + [ + -18, + 83, + 24 + ], + [ + -21, + 83, + 25 + ] + ], + "interacts": [ + { + "loc": [ + -21.5, + 83, + 25.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [ + [ + -18.5, + 91, + 24.5 + ], + [ + -9.5, + 83, + 2.5 + ] + ], + "mines": [], + "locations": [ + [ + -21, + 83, + 25 + ], + [ + -19, + 92, + 25 + ], + [ + -19, + 91, + 25 + ], + [ + -17, + 91, + 22 + ], + [ + -17, + 91, + 21 + ], + [ + -15, + 91, + 18 + ], + [ + -16, + 91, + 21 + ], + [ + -16, + 91, + 19 + ], + [ + -15, + 90, + 17 + ], + [ + -15, + 88, + 16 + ], + [ + -14, + 86, + 13 + ], + [ + -15, + 86, + 10 + ], + [ + -15, + 84, + 8 + ], + [ + -15, + 83, + 6 + ], + [ + -16, + 83, + 4 + ], + [ + -10, + 84, + 3 + ], + [ + -10, + 83, + 3 + ], + [ + -8, + 83, + 3 + ] + ], + "interacts": [ + { + "loc": [ + -4.5, + 84, + 1.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [ + [ + -4.5, + 88, + 1.5 + ], + [ + -4.5, + 92, + 1.5 + ] + ], + "mines": [], + "locations": [ + [ + -8, + 83, + 3 + ], + [ + -5, + 89, + 2 + ], + [ + -5, + 88, + 2 + ], + [ + -5, + 92, + 2 + ] + ], + "interacts": [ + { + "loc": [ + -4.5, + 93, + 1.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [], + "mines": [], + "locations": [ + [ + -5, + 92, + 2 + ], + [ + -8, + 92, + 2 + ], + [ + -11, + 92, + 1 + ], + [ + -11, + 96, + 1 + ], + [ + -11, + 97, + 1 + ], + [ + -13, + 96, + 1 + ], + [ + -13, + 97, + 1 + ], + [ + -13, + 96, + 1 + ], + [ + -13, + 92, + 1 + ], + [ + -13, + 92, + 2 + ], + [ + -13, + 92, + 1 + ], + [ + -13, + 93, + 1 + ], + [ + -13, + 92, + 1 + ] + ], + "interacts": [ + { + "loc": [ + -16.5, + 92, + 0.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [ + [ + -6.5, + 91, + 8.5 + ] + ], + "mines": [], + "locations": [ + [ + -13, + 92, + 1 + ], + [ + -13, + 93, + 1 + ], + [ + -13, + 93, + 2 + ], + [ + -14, + 92, + 2 + ], + [ + -15, + 92, + 2 + ], + [ + -16, + 92, + 2 + ], + [ + -18, + 92, + 3 + ], + [ + -18, + 92, + 4 + ], + [ + -18, + 92, + 5 + ], + [ + -18, + 93, + 5 + ], + [ + -18, + 94, + 5 + ], + [ + -18, + 93, + 8 + ], + [ + -18, + 92, + 9 + ], + [ + -18, + 90, + 10 + ], + [ + -18, + 87, + 11 + ], + [ + -18, + 84, + 11 + ], + [ + -18, + 83, + 11 + ], + [ + -7, + 91, + 9 + ], + [ + -8, + 91, + 8 + ], + [ + -8, + 93, + 8 + ], + [ + -8, + 92, + 8 + ], + [ + -10, + 92, + 10 + ], + [ + -10, + 90, + 10 + ], + [ + -10, + 87, + 11 + ], + [ + -8, + 86, + 11 + ], + [ + -7, + 85, + 12 + ], + [ + -7, + 83, + 12 + ], + [ + -5, + 83, + 10 + ], + [ + -1, + 83, + 11 + ], + [ + 3, + 83, + 12 + ], + [ + 7, + 83, + 12 + ], + [ + 9, 82, - -19 + 12 ], [ - 5, + 11, 80, - -19 + 13 ], [ - 5, - 78, - -19 + 12, + 77, + 13 ], [ - 5, - 74, - -19 + 13, + 73, + 14 ], [ - 5, - 72, - -19 + 14, + 68, + 14 ], [ - 4, - 69, + 15, + 62, + 15 + ], + [ + 15, + 55, + 15 + ], + [ + 15, + 48, + 16 + ], + [ + 13, + 46, + 16 + ], + [ + 10, + 46, + 17 + ], + [ + 7, + 46, + 17 + ], + [ + 3, + 46, + 17 + ], + [ + -1, + 46, + 16 + ], + [ + -6, + 46, + 16 + ], + [ + -9, + 45, + 15 + ], + [ + -12, + 45, + 14 + ], + [ + -17, + 47, + 13 + ], + [ + -20, + 48, + 11 + ], + [ + -23, + 48, + 10 + ], + [ + -24, + 49, + 10 + ], + [ + -24, + 48, + 10 + ], + [ + -24, + 47, + 10 + ], + [ + -25, + 48, + 10 + ], + [ + -25, + 47, + 10 + ], + [ + -25, + 36, + 10 + ], + [ + -25, + 35, + 10 + ], + [ + -25, + 34, + 10 + ], + [ + -25, + 33, + 10 + ], + [ + -14, + 29, + 10 + ], + [ + -14, + 28, + 10 + ] + ], + "interacts": [ + { + "loc": [ + -9.5, + 28, + 9.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [], + "mines": [], + "locations": [ + [ + -14, + 28, + 10 + ], + [ + -25, + 34, + 10 + ], + [ + -25, + 35, + 10 + ], + [ + -25, + 36, + 10 + ], + [ + -25, + 47, + 10 + ], + [ + -25, + 48, + 10 + ], + [ + -24, + 48, + 10 + ], + [ + -24, + 49, + 10 + ], + [ + -23, + 48, + 10 + ], + [ + -21, + 48, + 10 + ], + [ + -20, + 47, + 10 + ], + [ + -19, + 47, + 11 + ], + [ + -20, + 47, + 10 + ], + [ + -20, + 47, + 9 + ], + [ + -14, + 48, + 1 + ], + [ + -13, + 48, + 0 + ], + [ + -14, + 49, + -3 + ], + [ + -15, + 49, + -7 + ], + [ + -15, + 49, + -11 + ], + [ + -14, + 49, + -15 + ], + [ + -13, + 49, -19 ], [ - 5, - 69, + -13, + 49, + -23 + ], + [ + -13, + 50, + -24 + ], + [ + -13, + 50, + -26 + ], + [ + -13, + 50, + -28 + ], + [ + -11, + 50, + -27 + ], + [ + -9, + 50, + -27 + ] + ], + "interacts": [ + { + "loc": [ + -3.5, + 50, + -26.5 + ], + "type": "interact" + } + ], + "tnts": [] + }, + { + "etherwarps": [], + "mines": [], + "locations": [ + [ + -9, + 50, + -27 + ], + [ + -10, + 50, + -28 + ], + [ + -11, + 50, + -29 + ], + [ + -13, + 50, + -26 + ], + [ + -13, + 50, + -24 + ], + [ + -14, + 50, + -22 + ], + [ + -16, + 50, + -20 + ], + [ + -18, + 49, -19 ], [ - 7, - 69, + -21, + 50, -16 ], [ - 8, - 71, - -16 + -23, + 52, + -14 ], [ - 9, - 71, - -15 + -25, + 53, + -10 ], [ - 9, - 72, + -26, + 55, + -8 + ], + [ + -26, + 55, + -5 + ], + [ + -26, + 55, + -3 + ], + [ + -24, + 55, + -3 + ], + [ + -20, + 55, + -3 + ], + [ + -17, + 55, -2 ], [ - 9, - 71, - -1 + -13, + 55, + -2 ], [ - 9, + -10, + 55, + -3 + ], + [ + -9, + 55, + -2 + ], + [ + -9, + 67, + -7 + ], + [ + -9, + 66, + -7 + ], + [ + -9, 68, - 0 + -9 ], [ - 8, - 65, - 1 + -9, + 69, + -12 ], [ - 4, - 70, - 12 + -10, + 69, + -16 ], [ - -1, - 71, - 22 + -14, + 69, + -17 ], [ - -1, + -16, 69, - 22 + -17 ], [ - -1, + -17, 69, - 23 + -17 ], [ - 0, + -18, 69, - 25 + -16 + ] + ], + "interacts": [], + "tnts": [] + } + ] + }, + { + "index": 12, + "data": [ + { + "etherwarps": [ + [ + 2.5, + 80, + -1.5 + ] + ], + "mines": [ + [ + 1.5, + 83.5, + -0.5 + ] + ], + "locations": [ + [ + -7, + 69, + 3 ], [ - 0, + -6, + 69, + 3 + ], + [ + -3, 69, - 26 + 0 ], [ - 0, + -1, 69, - 27 + -2 ], [ 0, 69, - 25 + -4 ], [ 1, 69, - 22 + -5 ], [ 3, 69, - 21 + -7 + ], + [ + 3, + 69, + -10 + ], + [ + 5, + 69, + -12 ], [ 8, 69, - 20 + -12 ], [ - 9, + 11, 69, - 20 + -10 ], [ - 9, - 82, - 20 + 11, + 69, + -8 ], [ 11, - 82, - 19 + 69, + -9 ], [ - 12, - 82, - 19 + 10, + 69, + -12 ], [ - 13, - 94, - 22 + 7, + 69, + -12 ], [ - 13, - 93, - 22 + 3, + 69, + -11 ], [ - 15, - 93, - 23 + 2, + 69, + -8 ], [ - 17, - 91, - 23 + 1, + 69, + -4 ], [ - 17, - 89, - 23 + 1, + 69, + -3 ], [ - 18, - 85, - 23 + 2, + 69, + -3 ], [ - 18, - 82, - 23 + 2, + 80, + -1 ], [ - 17, - 82, - 22 + 1, + 80, + 0 ], [ - 15, - 82, - 18 + 1, + 80, + 1 ], [ - 13, - 82, - 14 + 1, + 80, + 0 ], [ - 11, - 82, - 11 + 1, + 80, + 1 ], [ - 10, + 0, 80, - 9 + 3 ], [ - 9, - 77, - 8 + -1, + 78, + 5 ], [ - 8, - 73, - 6 + -2, + 76, + 5 ], [ - 8, - 68, + -3, + 75, 5 ], [ - 6, - 65, - 3 + -4, + 73, + 5 ], [ - 2, - 65, - 2 + -4, + 70, + 5 ], [ - 0, - 65, - 1 + -5, + 69, + 5 ] ], "interacts": [], "tnts": [ [ - 12.5, - 69.5, - -24.5 - ], - [ - 0.5, + 3.5, 70.5, - 25.5 + -7.5 ] ] } |