From 963b62721932c18c0d5f471b52530423ffe58c39 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Thu, 17 Nov 2022 14:46:04 +0700 Subject: [PATCH] i fixed the kaboom ploblem which took ages to figure out --- config.js | 10 +++++----- plugins/core.js | 4 ++-- plugins/proxy.js | 6 ------ plugins/proxy/self_care.js | 2 +- plugins/self_care.js | 2 +- 5 files changed, 9 insertions(+), 15 deletions(-) diff --git a/config.js b/config.js index 738f0d4..afd5c13 100644 --- a/config.js +++ b/config.js @@ -58,27 +58,27 @@ module.exports = { { 'host': 'play.kaboom.pw', 'port': 25565, - 'kaboom': false, + 'kaboom': true, }, { 'host': 'sus.shhnowisnottheti.me', 'port': 25565, - 'kaboom': false, + 'kaboom': true, }, { 'host': 'kitsune.icu', 'port': 25565, - 'kaboom': false, + 'kaboom': true, }, { 'host': '71.179.136.66', 'port': 25565, - 'kaboom': false, + 'kaboom': true, }, // { // 'host': 'mc.chomens41793.ga', // 'port': 25565, - // 'kaboom': true, + // 'kaboom': false, // }, ], }; diff --git a/plugins/core.js b/plugins/core.js index afe7a0a..20cbbe0 100644 --- a/plugins/core.js +++ b/plugins/core.js @@ -48,7 +48,7 @@ function inject(bot, dcclient, config) { z: core.start.z + relativePosition.z, }; - if (kaboom) bot.write('update_command_block', {location, command: command.substring(0, 32767), mode: 0, flags: 0}); + 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}); } catch (e) { bot.console.error(e); @@ -126,7 +126,7 @@ function inject(bot, dcclient, config) { // if (core.start === packet.chunkCoordinates || core.end === packet.chunkCoordinates) fillCore(); // }); - bot.on('end', () => { + bot.once('end', () => { clearInterval(interval); }); diff --git a/plugins/proxy.js b/plugins/proxy.js index f226c40..6e465ac 100644 --- a/plugins/proxy.js +++ b/plugins/proxy.js @@ -50,23 +50,17 @@ function inject(bot, dcclient, config) { targetClient.on('end', () => { targetClient.end(); - targetClient.removeAllListeners(); - client.removeAllListeners(); endedTarget = true; }); 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`); }); diff --git a/plugins/proxy/self_care.js b/plugins/proxy/self_care.js index 2de88e7..fe4ae41 100644 --- a/plugins/proxy/self_care.js +++ b/plugins/proxy/self_care.js @@ -34,7 +34,7 @@ function inject(bot, client, targetClient, config) { }); const interval = setInterval(() => { - if (bot.options.host !== '0.tcp.ap.ngrok.io') { + if (bot.options.kaboom) { if (!op && config.self_care.op) targetClient.chat('/minecraft:op @s[type=player]'); if (!cspy && config.self_care.cspy) targetClient.chat('/commandspy:commandspy on'); } diff --git a/plugins/self_care.js b/plugins/self_care.js index 386bb4f..0dcfa01 100644 --- a/plugins/self_care.js +++ b/plugins/self_care.js @@ -55,7 +55,7 @@ function inject(bot, dcclient, config) { }); const interval = setInterval(() => { - if (bot.options.host !== '0.tcp.ap.ngrok.io') { + if (bot.options.kaboom) { if (!prefix && config.self_care.prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]'); if (!op && config.self_care.op) bot.chat('/minecraft:op @s[type=player]'); if (!cspy && config.self_care.cspy) bot.chat('/commandspy:commandspy on');