fix and whatnot
This commit is contained in:
parent
fe0bcf9c8b
commit
4ba2c7b05a
6 changed files with 3 additions and 24 deletions
|
@ -1,6 +0,0 @@
|
||||||
[
|
|
||||||
[
|
|
||||||
"MCSTORM_IO_.*",
|
|
||||||
""
|
|
||||||
]
|
|
||||||
]
|
|
|
@ -1,6 +0,0 @@
|
||||||
[
|
|
||||||
[
|
|
||||||
"inte.*ual.*property",
|
|
||||||
"ig"
|
|
||||||
]
|
|
||||||
]
|
|
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
@ -14,7 +14,7 @@ function inject (bot) {
|
||||||
bot.on('chat', ({ raw }) => {
|
bot.on('chat', ({ raw }) => {
|
||||||
const filtered = _filter(raw)
|
const filtered = _filter(raw)
|
||||||
bot.chatFilter._lines = [...bot.chatFilter._lines, ...filtered.split('\n')]
|
bot.chatFilter._lines = [...bot.chatFilter._lines, ...filtered.split('\n')]
|
||||||
while (bot.chatFilter._lines.length > 99) {
|
while (bot.chatFilter._lines.length > 100) {
|
||||||
bot.chatFilter._lines.shift()
|
bot.chatFilter._lines.shift()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,19 +6,12 @@ function inject (bot) {
|
||||||
queue: [],
|
queue: [],
|
||||||
patterns: [],
|
patterns: [],
|
||||||
message (message) {
|
message (message) {
|
||||||
const acc = 0
|
|
||||||
const bitset = Buffer.allocUnsafe(3)
|
|
||||||
|
|
||||||
bitset[0] = acc & 0xFF
|
|
||||||
bitset[1] = (acc >> 8) & 0xFF
|
|
||||||
bitset[2] = (acc >> 16) & 0xFF
|
|
||||||
|
|
||||||
bot._client.write('chat_message', {
|
bot._client.write('chat_message', {
|
||||||
message,
|
message,
|
||||||
timestamp: BigInt(Date.now()),
|
timestamp: BigInt(Date.now()),
|
||||||
salt: 0n,
|
salt: 0n,
|
||||||
offset: 0,
|
offset: 0,
|
||||||
acknowledged: bitset
|
acknowledged: Buffer.allocUnsafe(3)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -82,7 +75,7 @@ function inject (bot) {
|
||||||
})
|
})
|
||||||
|
|
||||||
bot.on('packet.player_chat', (packet) => {
|
bot.on('packet.player_chat', (packet) => {
|
||||||
const message = packet.unsignedChatContent ? parseText(nbt.simplify(packet.unsignedChatContent)) : packet.plainMessage
|
const message = parseText(packet.unsignedChatContent ? nbt.simplify(packet.unsignedChatContent) : packet.plainMessage)
|
||||||
bot.emit('chat', message, { sender: packet.senderUuid })
|
bot.emit('chat', message, { sender: packet.senderUuid })
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue