aboutsummaryrefslogtreecommitdiff
path: root/commands/claim.js
diff options
context:
space:
mode:
authorNinjune <enderknight537@gmail.com>2022-12-02 17:42:08 -0600
committerNinjune <enderknight537@gmail.com>2022-12-02 17:42:08 -0600
commit1d26a47068b357c4a9f4cb0225aa063134e9a0d9 (patch)
treef5d62828a9330c47f4e3675197625c464f8a9400 /commands/claim.js
parent86417e52fa78ea4096a155c2e70183d34aeaf530 (diff)
downloadcoleweight-1.6.11.tar.gz
coleweight-1.6.11.tar.bz2
coleweight-1.6.11.zip
v1.6.10v1.6.11
Diffstat (limited to 'commands/claim.js')
-rw-r--r--commands/claim.js14
1 files changed, 12 insertions, 2 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', () => {