aboutsummaryrefslogtreecommitdiff
path: root/commands/coords/temple.js
blob: f60e72403a448b89800dfa4c68792ff5b93f8585 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
import constants from "../../util/constants"
import { waypointRender } from "../../util/helperFunctions"

const PREFIX = constants.PREFIX
let waypoints = []

export function temple(arg) 
{
    const WAYPOINTNAME = "Temple"
    
    if(arg != "toggle")
    {
        new TextComponent(`${PREFIX}&bStand on the leftmost key guardian and do /cw ${WAYPOINTNAME} toggle`)
        .chat()
    }
    else
    {
        if(waypoints[0] == undefined)
        {
            let startPos = [Player.getX(), Player.getY(), Player.getZ()],
             x = startPos[0], 
             y = startPos[1], 
             z = startPos[2]
            
            waypoints.push([x + 61, y + -44, z + 18])

            ChatLib.chat(`${PREFIX}&b${WAYPOINTNAME} waypoints turned on!`)
        }
        else 
        {
            waypoints = []
            ChatLib.chat(`${PREFIX}&b${WAYPOINTNAME} waypoints turned off!`)
        }
    }
}

register("renderWorld", () => {
    waypointRender(waypoints)
})


register("worldLoad", () => {
    waypoints = []
})

export default ""