diff options
Diffstat (limited to 'commands')
-rw-r--r-- | commands/claim.js | 14 | ||||
-rw-r--r-- | commands/divans.js | 2 | ||||
-rw-r--r-- | commands/spiral.js | 4 | ||||
-rw-r--r-- | commands/throne.js | 7 | ||||
-rw-r--r-- | commands/yog.js | 5 |
5 files changed, 22 insertions, 10 deletions
diff --git a/commands/claim.js b/commands/claim.js index ae20924..52cb5f8 100644 --- a/commands/claim.js +++ b/commands/claim.js @@ -27,15 +27,21 @@ export function claim(structure) 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!`) + return + } else { - 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) + return } + else + ChatLib.chat(`${PREFIX}&cError: ${res.data.reason}.`) } }) .catch(err => { @@ -45,7 +51,11 @@ export function claim(structure) } 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) + try + { + Client.getMinecraft().func_152347_ac().joinServer(Client.getMinecraft().func_110432_I().func_148256_e(), Client.getMinecraft().func_110432_I().func_148254_d(), serverId) + } + catch(e) {} }) register('worldLoad', () => { diff --git a/commands/divans.js b/commands/divans.js index b1ee97c..c5e618a 100644 --- a/commands/divans.js +++ b/commands/divans.js @@ -1,5 +1,5 @@ import constants from "../util/constants" -import { waypointRender } from "../util/waypoints" +import { waypointRender } from "../util/helperFunctions" const PREFIX = constants.PREFIX let divanWaypoints = [] diff --git a/commands/spiral.js b/commands/spiral.js index e25bbb5..6574f18 100644 --- a/commands/spiral.js +++ b/commands/spiral.js @@ -1,5 +1,5 @@ import constants from "../util/constants" -import { waypointRender } from "../util/waypoints" +import { waypointRender } from "../util/helperFunctions" const PREFIX = constants.PREFIX let spiralWaypoints = [] @@ -45,7 +45,7 @@ export function spiral(arg2) } register("renderWorld", () => { - waypointRender(spiralWaypoints) + waypointRender(spiralWaypoints, true) }) register("worldLoad", () => { diff --git a/commands/throne.js b/commands/throne.js index cab7779..517c93d 100644 --- a/commands/throne.js +++ b/commands/throne.js @@ -1,9 +1,10 @@ import constants from "../util/constants" -import { waypointRender } from "../util/waypoints" +import { waypointRender } from "../util/helperFunctions" const PREFIX = constants.PREFIX let throneWaypoints = [] + export function throne(arg2) { if(arg2 != "toggle") @@ -38,10 +39,12 @@ export function throne(arg2) } } + register("renderWorld", () => { - waypointRender(throneWaypoints) + waypointRender(throneWaypoints, true) }) + register("worldLoad", () => { throneWaypoints = [] }) diff --git a/commands/yog.js b/commands/yog.js index 9758321..1544553 100644 --- a/commands/yog.js +++ b/commands/yog.js @@ -1,4 +1,5 @@ import constants from "../util/constants" +import { waypointRender } from "../util/helperFunctions" const PREFIX = constants.PREFIX let yogWaypoints = [] @@ -51,9 +52,7 @@ export function yog(arg2) register("renderWorld", () => { if(yogWaypoints.length < 1) return - yogWaypoints.forEach((waypoint) => { - Tessellator.drawString(Math.floor((Math.abs(parseInt(Player.getX()) - waypoint[0]) + Math.abs(parseInt(Player.getY()) - waypoint[1]) + Math.abs(parseInt(Player.getZ()) - waypoint[2]))/3) + "m", waypoint[0], waypoint[1], waypoint[2]) - }) + waypointRender(yogWaypoints) }) register("worldLoad", () => { |