mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54:55 -05:00
i give up i can't do it :(((((((
This commit is contained in:
parent
678aa22e93
commit
d0f16fd484
1 changed files with 8 additions and 18 deletions
|
@ -47,7 +47,7 @@ class TabCompletePlayerRequester {
|
||||||
constructor(bot) {
|
constructor(bot) {
|
||||||
this.bot = bot;
|
this.bot = bot;
|
||||||
|
|
||||||
bot.on('target_packet', (name, data) => {
|
bot._client.on('target_packet', (name, data) => {
|
||||||
if (name !== 'tab_complete') return;
|
if (name !== 'tab_complete') return;
|
||||||
|
|
||||||
const players = data.matches
|
const players = data.matches
|
||||||
|
@ -107,10 +107,8 @@ function inject(bot, dcclient, config) {
|
||||||
});
|
});
|
||||||
|
|
||||||
function addPlayer(player, packet) {
|
function addPlayer(player, packet) {
|
||||||
if (bot.options.host === 'sus.shhnowisnottheti.me') {
|
// if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet);
|
||||||
if (bot.players.getPlayer(player)) bot.emit('player_unvanished', player, packet);
|
// else bot.emit('player_added', player, packet);
|
||||||
else bot.emit('player_added', player, packet);
|
|
||||||
}
|
|
||||||
|
|
||||||
bot.players.addPlayer(player);
|
bot.players.addPlayer(player);
|
||||||
}
|
}
|
||||||
|
@ -146,19 +144,11 @@ function inject(bot, dcclient, config) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function removePlayer(player, packet) {
|
async function removePlayer(player, packet) {
|
||||||
if (bot.options.host === 'sus.shhnowisnottheti.me') {
|
// const fullPlayer = bot.players.getPlayer(player);
|
||||||
const fullPlayer = bot.players.getPlayer(player);
|
// const players = await bot.requester.getPlayerList();
|
||||||
|
//
|
||||||
const players = await bot.requester.getPlayerList();
|
// if (fullPlayer && players.some((name) => name === fullPlayer.name)) bot.emit('player_vanished', player);
|
||||||
|
/* else */bot.emit('player_removed', player, packet);
|
||||||
if (fullPlayer && players.some((name) => name === fullPlayer.name)) {
|
|
||||||
bot.emit('player_vanished', player);
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bot.emit('player_removed', player, packet);
|
|
||||||
|
|
||||||
bot.players.removePlayer(player);
|
bot.players.removePlayer(player);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue