mirror of
https://github.com/ChomeNS/chomens-bot-mc.git
synced 2024-11-14 10:44:55 -05:00
place cmd block when position change + revert chat
This commit is contained in:
parent
2c414264c7
commit
d432c2d3af
2 changed files with 4 additions and 8 deletions
|
@ -18,12 +18,7 @@ function inject(bot) {
|
|||
bot.on('parsed_chat', (message, packet) => {
|
||||
try {
|
||||
const raw = message.toMotd().substring(0, 32767);
|
||||
if (raw.match(/.* .*:§r .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, '');
|
||||
const message = raw.split(':§r ')[1];
|
||||
bot.emit('message', username, message, packet.sender);
|
||||
} else if (raw.match(/.* .*: .*/g)) {
|
||||
if (raw.match(/.* .*: .*/g)) {
|
||||
// if (packet.sender === '00000000-0000-0000-0000-000000000000') return;
|
||||
const username = raw.replace(/.*?\[.*?\] /, '').replace(/:.*/g, '').replace(/§#....../gm, '');
|
||||
const message = raw.split(': ')[1];
|
||||
|
|
|
@ -116,8 +116,6 @@ function inject(bot) {
|
|||
// if (core.start===packet.chunkCoordinates || core.end===packet.chunkCoordinates) fillCore();
|
||||
// });
|
||||
|
||||
// bot.on('position', fillCore);
|
||||
|
||||
bot.on('end', () => {
|
||||
clearInterval(interval);
|
||||
});
|
||||
|
@ -138,6 +136,9 @@ function inject(bot) {
|
|||
}
|
||||
|
||||
bot.core.loopPlace();
|
||||
|
||||
bot.on('position', bot.core.loopPlace);
|
||||
|
||||
const interval = setInterval(() => {
|
||||
bot.core.loopPlace();
|
||||
}, config.core.refillInterval);
|
||||
|
|
Loading…
Reference in a new issue