mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-27 09:35:35 -05:00
"it is 100% not the best way to fix but it just works"
This commit is contained in:
parent
963b627219
commit
d8234b10d5
2 changed files with 5 additions and 4 deletions
|
@ -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);
|
||||
}
|
||||
|
|
|
@ -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`);
|
||||
});
|
||||
|
||||
|
|
Loading…
Reference in a new issue