From 3993d67a8b7b77846cddedaec569622cf3fd1d78 Mon Sep 17 00:00:00 2001 From: ChomeNS Date: Mon, 16 Jan 2023 19:20:39 +0700 Subject: [PATCH] fix target.chat (because new nmp version) --- plugins/proxy.js | 3 ++- plugins/proxy/custom_chat.js | 2 +- plugins/proxy/self_care.js | 6 +++--- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/plugins/proxy.js b/plugins/proxy.js index 48aa84a..dd04423 100644 --- a/plugins/proxy.js +++ b/plugins/proxy.js @@ -39,7 +39,8 @@ function inject (bot, dcclient, config) { const clientPacketBlacklist = [] const targetPacketBlacklist = [] - target.chat = function (message) { + // target.chat exist so yeah.. + target.sendMessage = function (message) { if (minecraftVersionToNumber(target.version) >= 1.19) { if (message.startsWith('/')) { target.write('chat_command', { diff --git a/plugins/proxy/custom_chat.js b/plugins/proxy/custom_chat.js index 03b6122..2fa8945 100644 --- a/plugins/proxy/custom_chat.js +++ b/plugins/proxy/custom_chat.js @@ -50,7 +50,7 @@ function inject (bot, client, target, config, clientPacketBlacklist) { ] }) } else { - target.chat(data) + target.sendMessage(data) } }) }; diff --git a/plugins/proxy/self_care.js b/plugins/proxy/self_care.js index 940eb44..b5213d7 100644 --- a/plugins/proxy/self_care.js +++ b/plugins/proxy/self_care.js @@ -34,10 +34,10 @@ function inject (bot, client, target, config) { const interval = setInterval(() => { if (bot.options.kaboom) { - if (!op && config.self_care.op) target.chat('/minecraft:op @s[type=player]') - if (!cspy && config.self_care.cspy) target.chat('/commandspy:commandspy on') + if (!op && config.self_care.op) target.sendMessage('/minecraft:op @s[type=player]') + if (!cspy && config.self_care.cspy) target.sendMessage('/commandspy:commandspy on') } - // if (gameMode !== 1 && config.self_care.gamemode) target.chat('/minecraft:gamemode creative @s[type=player]') + // if (gameMode !== 1 && config.self_care.gamemode) target.sendMessage('/minecraft:gamemode creative @s[type=player]') }, config.self_care_check_interval) bot.on('end', () => {