mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 18:54:55 -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;
|
relativePosition.z = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
const kaboom = bot.options.kaboom;
|
|
||||||
|
|
||||||
const location = {
|
const location = {
|
||||||
x: core.start.x + relativePosition.x,
|
x: core.start.x + relativePosition.x,
|
||||||
y: core.start.y + relativePosition.y,
|
y: core.start.y + relativePosition.y,
|
||||||
z: core.start.z + relativePosition.z,
|
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: 2, flags: 0b101});
|
||||||
bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: kaboom ? 2 : 1, flags: 0b100});
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
bot.console.error(e);
|
bot.console.error(e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -56,11 +56,15 @@ function inject(bot, dcclient, config) {
|
||||||
client.on('end', function() {
|
client.on('end', function() {
|
||||||
endedClient = true;
|
endedClient = true;
|
||||||
targetClient.end();
|
targetClient.end();
|
||||||
|
targetClient.removeAllListeners();
|
||||||
|
client.removeAllListeners();
|
||||||
bot.console.info(`[Proxy] ${client.username} ended`);
|
bot.console.info(`[Proxy] ${client.username} ended`);
|
||||||
});
|
});
|
||||||
|
|
||||||
client.on('error', function() {
|
client.on('error', function() {
|
||||||
endedClient = true;
|
endedClient = true;
|
||||||
|
targetClient.removeAllListeners();
|
||||||
|
client.removeAllListeners();
|
||||||
bot.console.info(`[Proxy] ${client.username} got error`);
|
bot.console.info(`[Proxy] ${client.username} got error`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue