"it is 100% not the best way to fix but it just works"

This commit is contained in:
ChomeNS 2022-11-17 15:39:46 +07:00
parent 963b627219
commit d8234b10d5
2 changed files with 5 additions and 4 deletions

View file

@ -40,16 +40,13 @@ function inject(bot, dcclient, config) {
relativePosition.z = 0;
}
const kaboom = bot.options.kaboom;
const location = {
x: core.start.x + relativePosition.x,
y: core.start.y + relativePosition.y,
z: core.start.z + relativePosition.z,
};
if (!kaboom) bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: 0, flags: 0});
bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: kaboom ? 2 : 1, flags: 0b100});
bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: 2, flags: 0b101});
} catch (e) {
bot.console.error(e);
}

View file

@ -56,11 +56,15 @@ function inject(bot, dcclient, config) {
client.on('end', function() {
endedClient = true;
targetClient.end();
targetClient.removeAllListeners();
client.removeAllListeners();
bot.console.info(`[Proxy] ${client.username} ended`);
});
client.on('error', function() {
endedClient = true;
targetClient.removeAllListeners();
client.removeAllListeners();
bot.console.info(`[Proxy] ${client.username} got error`);
});