auto refill core ON BREAK + better self_care

This commit is contained in:
ChomeNS 2022-08-17 17:24:54 +07:00
parent 0b8af86ca5
commit 6d68fa18e4
3 changed files with 10 additions and 2 deletions

View file

@ -169,7 +169,7 @@ function main() {
} catch (e) { } catch (e) {
return; return;
} }
}, 500); }, 400);
module.exports = function() { module.exports = function() {
return bot; return bot;

View file

@ -63,6 +63,10 @@ function inject(bot) {
bot.emit('position', position); bot.emit('position', position);
}); });
bot._client.on('block_change', (packet) => {
if (core.isCore(packet.location) && packet.type===0) fillCore();
});
bot.on('position', fillCore); bot.on('position', fillCore);
fillCore(); fillCore();

View file

@ -54,7 +54,7 @@ function inject(bot) {
gameMode = data.gameMode; gameMode = data.gameMode;
}); });
setInterval(() => { const interval = setInterval(() => {
if (!op) { if (!op) {
bot.chat('/minecraft:op @s[type=player]'); bot.chat('/minecraft:op @s[type=player]');
return; return;
@ -66,6 +66,10 @@ function inject(bot) {
if (!prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]'); if (!prefix) bot.chat('/extras:prefix &8[&eChomeNS Bot&8]');
if (muted) bot.chat('/essentials:mute ' + bot.uuid); if (muted) bot.chat('/essentials:mute ' + bot.uuid);
}, 2000); }, 2000);
bot.once('end', () => {
clearInterval(interval);
});
} }
module.exports = {inject}; module.exports = {inject};