15 lines
374 B
JavaScript
15 lines
374 B
JavaScript
function inject (bot, client) {
|
|
bot.players ??= {}
|
|
|
|
client.on('player_info', (packet) => {
|
|
if (packet.action === 0) {
|
|
packet.data.forEach((player) => {
|
|
bot.players[player.name] = player
|
|
bot.players[player.UUID] = player
|
|
if (player.UUID === bot._client.uuid) { bot.player = player }
|
|
})
|
|
}
|
|
})
|
|
}
|
|
|
|
module.exports.client = inject
|