diff options
author | Ninjune x <enderknight537@gmail.com> | 2022-11-29 21:19:03 -0600 |
---|---|---|
committer | Ninjune x <enderknight537@gmail.com> | 2022-11-29 21:19:03 -0600 |
commit | ad055ba90a3055db32f04ff5163ff4e1c85dfdfa (patch) | |
tree | aee8962d031dffddd27fa702262a0ef7c66c08ce /commands | |
parent | 00f4ecbc69216d4aee44bcdac92955c4eb774298 (diff) | |
download | coleweight-ad055ba90a3055db32f04ff5163ff4e1c85dfdfa.tar.gz coleweight-ad055ba90a3055db32f04ff5163ff4e1c85dfdfa.tar.bz2 coleweight-ad055ba90a3055db32f04ff5163ff4e1c85dfdfa.zip |
Diffstat (limited to 'commands')
-rw-r--r-- | commands/claim.js | 50 | ||||
-rw-r--r-- | commands/divans.js | 83 | ||||
-rw-r--r-- | commands/grieferList.js | 23 | ||||
-rw-r--r-- | commands/help.js | 49 | ||||
-rw-r--r-- | commands/leaderboard.js | 14 | ||||
-rw-r--r-- | commands/markingLobbies.js | 17 | ||||
-rw-r--r-- | commands/spiral.js | 51 | ||||
-rw-r--r-- | commands/throne.js | 46 | ||||
-rw-r--r-- | commands/yog.js | 62 |
9 files changed, 320 insertions, 75 deletions
diff --git a/commands/claim.js b/commands/claim.js index d549056..ae20924 100644 --- a/commands/claim.js +++ b/commands/claim.js @@ -2,7 +2,7 @@ import axios from "../../axios" import settings from "../settings" import constants from "../util/constants" const PREFIX = constants.PREFIX - +const serverId = java.util.UUID.randomUUID().toString().replace("-", "") export function claim(structure) { @@ -23,35 +23,56 @@ export function claim(structure) ChatLib.chat(`${PREFIX}&cPlease enter the structure you wish to claim! (&3throne&c or &3spiral&c)`) return } - - axios.get(`https://ninjune.dev/api/claim?type=${structure}&id=${constants.serverData.server}&key=${constants.data.api_key}`) + + axios.get(`https://ninjune.dev/api/claim?type=${structure}&lobby=${constants.serverData.server}&username=${Player.getName()}&serverID=${serverId}`) .then(res => { if(res.data.success) ChatLib.chat(`${PREFIX}&aSuccessfully claimed ${constants.serverData.server} as your server!`) else - ChatLib.chat(`${PREFIX}&cError: ${res.data.reason}`) + { + ChatLib.chat(`${PREFIX}&cError: ${res.data.reason}.`) + if(res.data.code == 501) + { + ChatLib.chat(`${PREFIX}&cError: Not logged into the auth server. Try running the command again.`) + Client.getMinecraft().func_152347_ac().joinServer(Client.getMinecraft().func_110432_I().func_148256_e(), Client.getMinecraft().func_110432_I().func_148254_d(), serverId) + } + } }) .catch(err => { ChatLib.chat(`${PREFIX}&cError: ${err}`) }) - // key is used above to verify that the player trying to claim the lobby is the intended player, don't know a better way of doing this. + } +register('gameLoad', (event) => { + Client.getMinecraft().func_152347_ac().joinServer(Client.getMinecraft().func_110432_I().func_148256_e(), Client.getMinecraft().func_110432_I().func_148254_d(), serverId) +}) register('worldLoad', () => { if(!settings.claiming) return - + axios.get(`https://ninjune.dev/api/unclaim?username=${Player.getName()}&serverID=${serverId}`) + .then(res => { + if(settings.debug && !res.data.success) + ChatLib.chat("Unclaim: " + res.data.reason) + if(res.data.code == 501) + Client.getMinecraft().func_152347_ac().joinServer(Client.getMinecraft().func_110432_I().func_148256_e(), Client.getMinecraft().func_110432_I().func_148254_d(), serverId) + }) + .catch(err => { + if(settings.debug) + ChatLib.chat(`${PREFIX}&cError: ${err}`) + }) + // unclaims the lobby, isn't needed but will allow another player to claim lobby after claimer leaves. setTimeout(() => { const NetHandlerPlayClient = Client.getConnection(), - PlayerMap = NetHandlerPlayClient.func_175106_d() // getPlayerInfoMap + PlayerMap = NetHandlerPlayClient.func_175106_d() // getPlayerInfoMap if(settings.debug) console.log(constants.serverData.server) - axios.get(`https://ninjune.dev/api/claim?claimedlobby=${constants.serverData.server}`) + axios.get(`https://ninjune.dev/api/claimed?serverID=${constants.serverData.server}&authServer=${serverId}&passedName=${Player.getName()}`) .then(res => { if(res.data.claimed) { - PlayerMap.filter(player => player.func_178853_c() > 0 && !player.func_178845_a().name.startsWith("!")).forEach((PlayerMP) => { - let player = PlayerMP.func_178845_a().name + PlayerMap.filter(player => player.func_178853_c() /* getResponseTime */ > 0 && !player.func_178845_a()/* getGameProfile */.name.startsWith("!")).forEach((PlayerMP) => { + let player = PlayerMP.func_178845_a()/* getGameProfile */.name res.data.structures.forEach((structure) => { if (player == structure.player) @@ -60,15 +81,14 @@ register('worldLoad', () => { }) }) } + else if (res.data.err && settings.debug) + { + ChatLib.chat("Check claim: " + res.data.reason) + } }) .catch(err => { if(!settings.debug) return ChatLib.chat(`${PREFIX}&cError: ${err}`) }) }, 2000) -}) - -register('worldUnload', () => { - axios.get(`https://ninjune.dev/api/unclaim?claimedlobby=${constants.serverData.server}&key=${constants.data.api_key}`) - // unclaims the lobby, isn't needed but will allow another player to claim lobby after claimer leaves. key used to verify identity of unclaimer. })
\ No newline at end of file diff --git a/commands/divans.js b/commands/divans.js new file mode 100644 index 0000000..c5e618a --- /dev/null +++ b/commands/divans.js @@ -0,0 +1,83 @@ +import constants from "../util/constants" +import { waypointRender } from "../util/helperFunctions" + +const PREFIX = constants.PREFIX +let divanWaypoints = [] + +export function divans(arg2) +{ + const WAYPOINTNAME = "Divan" + + if(arg2 != "toggle") + { + new TextComponent(`${PREFIX}&bGo to the middle of jade crystal then do /cw coords divans toggle.`) + .chat() + } + else + { + if(divanWaypoints[0] == undefined) + { + let startPos = [Player.getX(), Player.getY(), Player.getZ()], + x = startPos[0], + y = startPos[1], + z = startPos[2] + + console.log(x + " " + y + " " + z) + divanWaypoints.push([x + 1, y + -40, z + -20]) + divanWaypoints.push([x + 30, y + -39, z + -25]) + divanWaypoints.push([x + -31, y + -39, z + -12]) + divanWaypoints.push([x + 1, y + -39, z + 20]) + divanWaypoints.push([x + -14, y + -39, z + 43]) + divanWaypoints.push([x + -12, y + -39, z + -44]) + divanWaypoints.push([x + -20, y + -40, z + 0]) + divanWaypoints.push([x + 22, y + -39, z + -14]) + divanWaypoints.push([x + 29, y + -39, z + -44]) + divanWaypoints.push([x + 12, y + -39, z + 7]) + divanWaypoints.push([x + 23, y + -40, z + -39]) + divanWaypoints.push([x + -37, y + -39, z + 11]) + divanWaypoints.push([x + 7, y + -39, z + 11]) + divanWaypoints.push([x + 6, y + -39, z + 11]) + divanWaypoints.push([x + -38, y + -40, z + 26]) + divanWaypoints.push([x + 12, y + -40, z + -22]) + divanWaypoints.push([x + -5, y + -39, z + 16]) + divanWaypoints.push([x + 40, y + -40, z + -30]) + divanWaypoints.push([x + 42, y + -37, z + -41]) + divanWaypoints.push([x + -23, y + -40, z + 40]) + divanWaypoints.push([x + 20, y + -40, z + 0]) + divanWaypoints.push([x + -24, y + -40, z + 12]) + divanWaypoints.push([x + 38, y + -40, z + -26]) + divanWaypoints.push([x + 43, y + -39, z + -16]) + divanWaypoints.push([x + -40, y + -40, z + 18]) + divanWaypoints.push([x + -17, y + -39, z + 20]) + divanWaypoints.push([x + 19, y + -40, z + 29]) + divanWaypoints.push([x + -37, y + -39, z + -14]) + divanWaypoints.push([x + -14, y + -39, z + 22]) + divanWaypoints.push([x + -42, y + -38, z + -28]) + divanWaypoints.push([x + -43, y + -40, z + -40]) + divanWaypoints.push([x + 25, y + -40, z + 17]) + divanWaypoints.push([x + 12, y + -40, z + 31]) + divanWaypoints.push([x + -31, y + -39, z + -40]) + divanWaypoints.push([x + -36, y + -38, z + 42]) + divanWaypoints.push([x + 7, y + -39, z + 22]) + divanWaypoints.push([x + 20, y + -39, z + -26]) + divanWaypoints.push([x + 12, y + -39, z + -43]) + ChatLib.chat(`${PREFIX}&b${WAYPOINTNAME} waypoints turned on!`) + } + else + { + divanWaypoints = [] + ChatLib.chat(`${PREFIX}&b${WAYPOINTNAME} waypoints turned off!`) + } + } +} + +register("renderWorld", () => { + waypointRender(divanWaypoints) +}) + + +register("worldLoad", () => { + divanWaypoints = [] +}) + +export default ""
\ No newline at end of file diff --git a/commands/grieferList.js b/commands/grieferList.js new file mode 100644 index 0000000..0762f8e --- /dev/null +++ b/commands/grieferList.js @@ -0,0 +1,23 @@ +/*import settings from "../settings" // future +import constants from "../util/constants" +const PREFIX = constants.PREFIX + +export function grieferList(arg2, arg3) +{ + switch(arg2) + { + case "list": + break + case "add": + let griefers = JSON.parse(FileLib.read("Coleweight", "config/grieferlist.txt")) + griefers.push({griefers: [name]}) + FileLib.write("Coleweight", "config/grieferlist.txt", `${JSON.stringify(griefers)}`) + ChatLib.chat(`${PREFIX}&aAdded ${arg3} to griefer list!`) + break + case "remove": + break + default: + ChatLib.chat(`${PREFIX}&cArgument '${arg2 ?? ""}' not found`) + break + } +}*/
\ No newline at end of file diff --git a/commands/help.js b/commands/help.js index 3c20b01..05c5a04 100644 --- a/commands/help.js +++ b/commands/help.js @@ -1,21 +1,34 @@ -import constants from "../util/constants" -const PREFIX = constants.PREFIX +const PREFIX = "◆" export function help() { - ChatLib.chat("") - ChatLib.chat(`${PREFIX}&b/cw [username] => Gets coleweight`) - ChatLib.chat(`${PREFIX}&b/cw help => This menu.`) - ChatLib.chat(`${PREFIX}&b/cw settings => Open settings.`) - ChatLib.chat(`${PREFIX}&b/cw time => Prints time on timer (timer gui doesn't have to be visible).`) - ChatLib.chat(`${PREFIX}&b/cw tick <mining speed> <('r','jade', etc) || breaking power of block> => Shows tick data.`) - ChatLib.chat(`${PREFIX}&b/cw info => Prints coleweight info.`) - ChatLib.chat(`${PREFIX}&b/cw claim <throne || spiral> => Claims a chollows sapphire structure in a lobby.`) - ChatLib.chat(`${PREFIX}&b/cw setkey <key> => Sets API key (can also use /api new)`) - ChatLib.chat(`${PREFIX}&b/cw reload => Reloads the gui.`) - ChatLib.chat(`${PREFIX}&b/cw throne => Guide for setting up waypoints for throne.`) - ChatLib.chat(`${PREFIX}&b/cw spiral => Guide for setting up waypoints for spiral.`) - ChatLib.chat(`${PREFIX}&b/cw leaderboard => Gets leaderboard within a specific range (like 20 40)`) - ChatLib.chat(`${PREFIX}&b/fetchdiscord (username) => Gets discord of username (if linked)`) - ChatLib.chat("") -}
\ No newline at end of file + ChatLib.chat("&b--------------[ &a&lColeweight &b]--------------") + ChatLib.chat(ChatLib.getCenteredText("&a&lInfo")) + helpCommand("", "Gets Coleweight of specified user", "(username)") + helpCommand("help", "This menu.", "") + helpCommand("time", "Prints time on timer (timer gui doesn't have to be visible).", "") + helpCommand("tick", "Shows tick data.", "(mining speed) (('r','jade', etc) || breaking power of block))") + helpCommand("leaderboard", "Shows leaderboard.", "(min) [max]") + helpCommand("info", "Prints coleweight info.", "") + ChatLib.chat(ChatLib.getCenteredText("&a&lSettings")) + helpCommand("settings", "Opens settings.", "") + helpCommand("claim", "Claims a chollows sapphire structure in a lobby.", "(throne || spiral)") + helpCommand("setkey", "Sets API key (can also use /api new)-", "(key)") + helpCommand("reload", "Reloads the gui.", "") + ChatLib.chat(ChatLib.getCenteredText("&a&lWaypoints")) + helpCommand("coords", "Opens coords gui.", "") + helpCommand("throne", "Guide for setting up waypoints for throne.", "[toggle]") + helpCommand("spiral", "Guide for setting up waypoints for spiral", "[toggle]") + helpCommand("yog", "Shows instructions for yog waypoints.", "[toggle]") + helpCommand("divans", "Guide for setting up waypoints for Mines of Divan treasures.", "[toggle]") + ChatLib.chat(ChatLib.getCenteredText("&a&lMiscellaneous")) + ChatLib.chat(`&a${PREFIX} /fetchdiscord (username) => &bGets discord of username (if linked)`) + ChatLib.chat("&b------------------------------------------") +} + +// Made by Almighty Stylla <3 +function helpCommand(command, desc, usage) +{ + ChatLib.chat(new TextComponent(`&a${PREFIX} /cw ${command} => &b${desc}`).setHoverValue(`${"/cw " + command + " " + usage}`)) +} + diff --git a/commands/leaderboard.js b/commands/leaderboard.js index 2b2699f..80a3448 100644 --- a/commands/leaderboard.js +++ b/commands/leaderboard.js @@ -4,13 +4,13 @@ const PREFIX = constants.PREFIX export function leaderboard(arg2, arg3) { - if(arg2 != undefined && parseInt(arg2) == arg2 && !isNaN(parseInt(arg2, 10))) + if(arg2 != undefined && parseInt(arg2) == arg2 && !isNaN(parseInt(arg2))) { - if(arg3 == undefined && parseInt(arg2) == arg2 && !isNaN(parseInt(arg2, 10))) + if(arg3 == undefined && parseInt(arg2) == arg2 && !isNaN(parseInt(arg2))) { - axios.get(`https://ninjune.dev/api/coleweight-leaderboard`) + axios.get(`https://ninjune.dev/api/coleweight-leaderboard?length=${arg2}`) .then(res => { - for(let i = 0; i < arg2; i++) + for(let i = 0; i < res.data.length; i++) { ChatLib.chat(`&a${res.data[i].rank}. &b${res.data[i].name}: &f${res.data[i].coleweight}`) } @@ -19,11 +19,11 @@ export function leaderboard(arg2, arg3) ChatLib.chat(`${PREFIX}&4Error! &eApi might be down.`) }) } - else if(parseInt(arg3) == arg3 && !isNaN(parseInt(arg3, 10))) + else if(parseInt(arg3) == arg3 && !isNaN(parseInt(arg3))) { - axios.get(`https://ninjune.dev/api/coleweight-leaderboard`) + axios.get(`https://ninjune.dev/api/coleweight-leaderboard?length=${arg3}`) .then(res => { - for(let i = arg2 - 1; i < arg3; i++) + for(let i = arg2 - 1; i < res.data.length; i++) { ChatLib.chat(`&a${res.data[i].rank}. &b${res.data[i].name}: &f${res.data[i].coleweight}`) } diff --git a/commands/markingLobbies.js b/commands/markingLobbies.js new file mode 100644 index 0000000..6db976e --- /dev/null +++ b/commands/markingLobbies.js @@ -0,0 +1,17 @@ +import settings from "../settings" +import constants from "../util/constants" +const PREFIX = constants.PREFIX +let lobbies = [] + +export function clearLobbies() +{ + lobbies = [] +} + +register('chat', (server) => { + if(!settings.lobbyMarking) return + if(lobbies.indexOf(server) > 0) + ChatLib.chat(`${PREFIX}&aYou've been in this lobby!`) + else + lobbies.push(server) +}).setCriteria(/Sending to server ([A-Za-z0-9]+)\.\.\./g)
\ No newline at end of file diff --git a/commands/spiral.js b/commands/spiral.js index 122ee08..6574f18 100644 --- a/commands/spiral.js +++ b/commands/spiral.js @@ -1,5 +1,8 @@ import constants from "../util/constants" +import { waypointRender } from "../util/helperFunctions" + const PREFIX = constants.PREFIX +let spiralWaypoints = [] export function spiral(arg2) { @@ -12,31 +15,41 @@ export function spiral(arg2) } else { - if(constants.spiralValues[0] == undefined) + if(spiralWaypoints[0] == undefined) { let startPos = [Player.getX(), Player.getY(), Player.getZ()] - constants.spiralValues.push([startPos[0]+2, startPos[1]-3, startPos[2]+14]) - constants.spiralValues.push([startPos[0]+3, startPos[1]-21, startPos[2]+6]) - constants.spiralValues.push([startPos[0]+6, startPos[1]-23, startPos[2]-1]) - constants.spiralValues.push([startPos[0]+19, startPos[1]+4, startPos[2]-5]) - constants.spiralValues.push([startPos[0]+21, startPos[1]-7, startPos[2]]) - constants.spiralValues.push([startPos[0]+25, startPos[1]-35, startPos[2]-8]) - constants.spiralValues.push([startPos[0]+39, startPos[1]-36, startPos[2]]) - constants.spiralValues.push([startPos[0]+52, startPos[1]-24, startPos[2]+1]) - constants.spiralValues.push([startPos[0]+48, startPos[1]+3, startPos[2]+3]) - constants.spiralValues.push([startPos[0]+47, startPos[1]+4, startPos[2]+22]) - constants.spiralValues.push([startPos[0]+55, startPos[1]-8, startPos[2]+42]) - constants.spiralValues.push([startPos[0]+46, startPos[1]-11, startPos[2]+49]) - constants.spiralValues.push([startPos[0]+26, startPos[1]+5, startPos[2]+39]) - constants.spiralValues.push([startPos[0]+20, startPos[1]+3, startPos[2]+41]) - constants.spiralValues.push([startPos[0]+8, startPos[1]-23, startPos[2]+32]) - constants.spiralValues.push([startPos[0]+4, startPos[1]-23, startPos[2]+28]) + spiralWaypoints.push([startPos[0]+2, startPos[1]-3, startPos[2]+14]) + spiralWaypoints.push([startPos[0]+3, startPos[1]-21, startPos[2]+6]) + spiralWaypoints.push([startPos[0]+6, startPos[1]-23, startPos[2]-1]) + spiralWaypoints.push([startPos[0]+19, startPos[1]+4, startPos[2]-5]) + spiralWaypoints.push([startPos[0]+21, startPos[1]-7, startPos[2]]) + spiralWaypoints.push([startPos[0]+25, startPos[1]-35, startPos[2]-8]) + spiralWaypoints.push([startPos[0]+39, startPos[1]-36, startPos[2]]) + spiralWaypoints.push([startPos[0]+52, startPos[1]-24, startPos[2]+1]) + spiralWaypoints.push([startPos[0]+48, startPos[1]+3, startPos[2]+3]) + spiralWaypoints.push([startPos[0]+47, startPos[1]+4, startPos[2]+22]) + spiralWaypoints.push([startPos[0]+55, startPos[1]-8, startPos[2]+42]) + spiralWaypoints.push([startPos[0]+46, startPos[1]-11, startPos[2]+49]) + spiralWaypoints.push([startPos[0]+26, startPos[1]+5, startPos[2]+39]) + spiralWaypoints.push([startPos[0]+20, startPos[1]+3, startPos[2]+41]) + spiralWaypoints.push([startPos[0]+8, startPos[1]-23, startPos[2]+32]) + spiralWaypoints.push([startPos[0]+4, startPos[1]-23, startPos[2]+28]) ChatLib.chat(`${PREFIX}&bSpiral waypoints turned on!`) } else { - constants.spiralValues = [] + spiralWaypoints = [] ChatLib.chat(`${PREFIX}&bSpiral waypoints turned off!`) } } -}
\ No newline at end of file +} + +register("renderWorld", () => { + waypointRender(spiralWaypoints, true) +}) + +register("worldLoad", () => { + spiralWaypoints = [] +}) + +export default ""
\ No newline at end of file diff --git a/commands/throne.js b/commands/throne.js index 717ba3c..517c93d 100644 --- a/commands/throne.js +++ b/commands/throne.js @@ -1,5 +1,9 @@ import constants from "../util/constants" +import { waypointRender } from "../util/helperFunctions" + const PREFIX = constants.PREFIX +let throneWaypoints = [] + export function throne(arg2) { @@ -9,28 +13,38 @@ export function throne(arg2) } else { - if(constants.throneValues[0] == undefined) + if(throneWaypoints[0] == undefined) { let startPos = [Player.getX()-24, Player.getY()+6, Player.getZ()-59] // calculated below values at a weird start so adjusting them - constants.throneValues.push([startPos[0]+8, startPos[1]+2, startPos[2]-5]) - constants.throneValues.push([startPos[0]+11, startPos[1]-35, startPos[2]-3]) - constants.throneValues.push([startPos[0]+2, startPos[1]-34, startPos[2]-4]) - constants.throneValues.push([startPos[0]+-2, startPos[1]-1, startPos[2]+49]) - constants.throneValues.push([startPos[0]+2, startPos[1]-13, startPos[2]+52]) - constants.throneValues.push([startPos[0]+27, startPos[1]-9, startPos[2]+51]) - constants.throneValues.push([startPos[0]+38, startPos[1]-15, startPos[2]+47]) - constants.throneValues.push([startPos[0]+41, startPos[1]-44, startPos[2]+46]) - constants.throneValues.push([startPos[0]+50, startPos[1]-28, startPos[2]+38]) - constants.throneValues.push([startPos[0]+55, startPos[1]-36, startPos[2]+29]) - constants.throneValues.push([startPos[0]+49, startPos[1]-31, startPos[2]+1]) - constants.throneValues.push([startPos[0]+50, startPos[1]-1, startPos[2]+10]) - constants.throneValues.push([startPos[0]+45, startPos[1]-3, startPos[2]-4]) + throneWaypoints.push([startPos[0]+8, startPos[1]+2, startPos[2]-5]) + throneWaypoints.push([startPos[0]+11, startPos[1]-35, startPos[2]-3]) + throneWaypoints.push([startPos[0]+2, startPos[1]-34, startPos[2]-4]) + throneWaypoints.push([startPos[0]+-2, startPos[1]-1, startPos[2]+49]) + throneWaypoints.push([startPos[0]+2, startPos[1]-13, startPos[2]+52]) + throneWaypoints.push([startPos[0]+27, startPos[1]-9, startPos[2]+51]) + throneWaypoints.push([startPos[0]+38, startPos[1]-15, startPos[2]+47]) + throneWaypoints.push([startPos[0]+41, startPos[1]-44, startPos[2]+46]) + throneWaypoints.push([startPos[0]+50, startPos[1]-28, startPos[2]+38]) + throneWaypoints.push([startPos[0]+55, startPos[1]-36, startPos[2]+29]) + throneWaypoints.push([startPos[0]+49, startPos[1]-31, startPos[2]+1]) + throneWaypoints.push([startPos[0]+50, startPos[1]-1, startPos[2]+10]) + throneWaypoints.push([startPos[0]+45, startPos[1]-3, startPos[2]-4]) ChatLib.chat(`${PREFIX}&bThrone waypoints turned on!`) } else { - constants.throneValues = [] + throneWaypoints = [] ChatLib.chat(`${PREFIX}&bThrone waypoints turned off!`) } } -}
\ No newline at end of file +} + + +register("renderWorld", () => { + waypointRender(throneWaypoints, true) +}) + + +register("worldLoad", () => { + throneWaypoints = [] +}) diff --git a/commands/yog.js b/commands/yog.js new file mode 100644 index 0000000..1544553 --- /dev/null +++ b/commands/yog.js @@ -0,0 +1,62 @@ +import constants from "../util/constants" +import { waypointRender } from "../util/helperFunctions" + +const PREFIX = constants.PREFIX +let yogWaypoints = [] + +export function yog(arg2) +{ + const WAYPOINTNAME = "Yog" + + if(arg2 != "toggle") + { + new TextComponent(`${PREFIX}&bGo to the leftmost corner of the topaz crystal facing bal close to bal then do /cw coords yog toggle.`) + .chat() + } + else + { + if(yogWaypoints[0] == undefined) + { + let startPos = [Player.getX(), Player.getY(), Player.getZ()], + x = startPos[0], + y = startPos[1], + z = startPos[2] + + console.log(x + " " + y + " " + z) + yogWaypoints.push([x + 10, y - 7, z - 27]) + yogWaypoints.push([x + 10, y - 7, z - 27]) + yogWaypoints.push([x + 28, y - 8, z + 15]) + yogWaypoints.push([x - 41, y - 3, z + 26]) + yogWaypoints.push([x - 32, y - 3, z + 45]) + yogWaypoints.push([x - 22, y - 3, z - 34]) + yogWaypoints.push([x + 28, y - 8, z + 36]) + yogWaypoints.push([x - 47, y - 3, z + 32]) + yogWaypoints.push([x - 43, y - 1, z + 4]) + yogWaypoints.push([x - 47, y + 2, z - 20]) + yogWaypoints.push([x + 11, y - 13, z + 40]) + yogWaypoints.push([x + 15, y - 13, z + 43]) + yogWaypoints.push([x - 44, y + 2, z - 29]) + yogWaypoints.push([x + 33, y - 4, z - 15]) + yogWaypoints.push([x - 6, y - 4, z - 34]) + yogWaypoints.push([x + 19, y - 12, z + 35]) + yogWaypoints.push([x + 16, y - 9, z - 15]) + ChatLib.chat(`${PREFIX}&b${WAYPOINTNAME} waypoints turned on!`) + } + else + { + yogWaypoints = [] + ChatLib.chat(`${PREFIX}&b${WAYPOINTNAME} waypoints turned off!`) + } + } +} + +register("renderWorld", () => { + if(yogWaypoints.length < 1) return + waypointRender(yogWaypoints) +}) + +register("worldLoad", () => { + yogWaypoints = [] +}) + +export default ""
\ No newline at end of file |