diff --git a/plugins/chatParsers/chat_cmm_mcp.js b/plugins/chatParsers/chat_cmm_mcp.js index e2f10c1..4fe47fd 100755 --- a/plugins/chatParsers/chat_cmm_mcp.js +++ b/plugins/chatParsers/chat_cmm_mcp.js @@ -11,7 +11,7 @@ module.exports = { parsed: true, json: data.json, type: data.type, - subtype: `chipmunkmod_mcp`, + subtype: 'chipmunkmod_mcp', uuid, message, nickname, diff --git a/plugins/chatParsers/chat_player.js b/plugins/chatParsers/chat_player.js index 89a9f6b..da5bde0 100755 --- a/plugins/chatParsers/chat_player.js +++ b/plugins/chatParsers/chat_player.js @@ -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, diff --git a/plugins/chatParsers/chat_system.js b/plugins/chatParsers/chat_system.js index 474f221..ef72219 100755 --- a/plugins/chatParsers/chat_system.js +++ b/plugins/chatParsers/chat_system.js @@ -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) diff --git a/plugins/chatParsers/chat_vanilla_legacy.js b/plugins/chatParsers/chat_vanilla_legacy.js index 1d25574..91b0a36 100755 --- a/plugins/chatParsers/chat_vanilla_legacy.js +++ b/plugins/chatParsers/chat_vanilla_legacy.js @@ -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 diff --git a/plugins/player.js b/plugins/player.js index 4054539..0d0cefe 100755 --- a/plugins/player.js +++ b/plugins/player.js @@ -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) => {