mirror of
https://code.chipmunk.land/Parker2991/NitoriBot/
synced 2026-12-06 09:25:43 -05:00
23 lines
550 B
JavaScript
23 lines
550 B
JavaScript
const mc = require('minecraft-protocol');
|
|
|
|
module.exports = {
|
|
data: {
|
|
description: "reconnects the players to the server",
|
|
enabled: true,
|
|
name: "reconnect",
|
|
type: "client"
|
|
},
|
|
inject (context) {
|
|
const bot = context.bot;
|
|
const config = context.config;
|
|
if (bot.server.reconnectDelay < 0) return
|
|
bot.on('end', () => {
|
|
setTimeout(() => {
|
|
let client = new mc.createClient(bot.server)
|
|
bot._client = client;
|
|
bot.emit('init_client', client)
|
|
}, bot.server.reconnectDelay);
|
|
})
|
|
}
|
|
}
|