This commit is contained in:
7cc5c4f330d47060 2024-09-19 23:27:19 -04:00
parent 86275ef8ed
commit 223cd5a0aa
Signed by: 7cc5c4f330d47060
SSH key fingerprint: SHA256:e+4tcZut1nBpe10PqjaO+Rvie0Q7W4qIvFzcUw+7riA
5 changed files with 18 additions and 19 deletions

View file

@ -11,7 +11,7 @@ module.exports = {
parsed: true,
json: data.json,
type: data.type,
subtype: `chipmunkmod_mcp`,
subtype: 'chipmunkmod_mcp',
uuid,
message,
nickname,

View file

@ -5,7 +5,7 @@ module.exports = {
parsed: true,
json: data.json,
type: data.type,
subtype: `generic_player`,
subtype: 'generic_player',
uuid: data.uuid,
message: data.message,
nickname: data.nickname,

View file

@ -2,20 +2,20 @@ const parsePlain = require('../../util/chatparse_plain.js')
module.exports = {
parse: (data, b) => {
if (data.type === 'system' || data.type === 'legacy') {
let subtype = `generic_system`
let subtype = 'generic_system'
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
const parsed = parsePlain(data.json)
const split = parsed.split(': ')
const chatName = split.splice(0, 1)[0]
const chatNameSplit = chatName.split(' ')
let uuid;
let username;
let nickname;
if(data.uuid){
uuid = data.uuid;
username = b.findRealNameFromUUID(uuid);
nickname = b.findDisplayName(uuid);
let uuid
let username
let nickname
if (data.uuid) {
uuid = data.uuid
username = b.findRealNameFromUUID(uuid)
nickname = b.findDisplayName(uuid)
} else {
nickname = chatNameSplit[chatNameSplit.length - 1]
username = b.findRealName(chatName)

View file

@ -2,7 +2,7 @@ const parsePlain = require('../../util/chatparse_plain.js')
module.exports = {
parse: (data, b) => {
if (data.type === 'legacy') {
let subtype = `vanilla_legacy`
let subtype = 'vanilla_legacy'
if (data.type === 'legacy' && data.uuid) subtype += '_withuuid'
if (data.json.translate === 'chat.type.text') { // Servers without Extras chat
let message

View file

@ -27,19 +27,18 @@ module.exports = {
}
}
for (const uuid in buffer2) {
if (!b.players[uuid]) b.players[uuid] = { displayName: '', realName: '' }
let displayName = "";
let realName = "";
if (buffer2[uuid].displayName){
let displayName = ''
let realName = ''
if (buffer2[uuid].displayName) {
displayName = buffer2[uuid].displayName
b.players[uuid].displayName = buffer2[uuid].displayName
}
if (buffer2[uuid].realName){
}
if (buffer2[uuid].realName) {
realName = buffer2[uuid].realName
b.players[uuid].realName = buffer2[uuid].realName
}
b.emit("playerdata",uuid,displayName,realName)
}
b.emit('playerdata', uuid, displayName, realName)
}
})
b.findUUID = (name) => {