rewrote the trust levels

This commit is contained in:
Parker2991
2025-09-12 12:54:08 -05:00
parent d2e2124fbe
commit a76e65b18f
34 changed files with 107 additions and 1343 deletions
+8 -4
View File
@@ -16,7 +16,7 @@ function tryParse(json) {
function parse (chatTypes, type, sender, target, message) {
const chatType = chatTypes[type]
const parsed = convertNbtComponentToJson(null, chatType.value.value.chat)
const json = { translate: parsed.translation_key, with: [] }
let json = { translate: parsed.translation_key, with: [] }
for (const parameter of parsed.parameters) {
@@ -29,6 +29,8 @@ function parse (chatTypes, type, sender, target, message) {
}
}
if (type === 4) json = message
return json
}
@@ -68,6 +70,8 @@ class chat {
type: "minecraft:disguised_chat",
message: parsed
})
tryParsingMessage(parsed, { senderName: sender, players: bot.players, getMessageAsPrismarine: bot.getMessageAsPrismarine, chatType: "minecraft:diguised_chat" })
});
bot.on("packet.player_chat", (packet, data) => {
@@ -81,7 +85,7 @@ class chat {
senderUuid: packet.senderUuid,
players: bot.players,
getMessageAsPrismarine: bot.getMessageAsPrismarine,
chatType: "player",
chatType: "minecraft:player_chat"
});
});
@@ -106,11 +110,11 @@ class chat {
});
bot.emit("system_chat", message);
if (bot.options.mode !== "savageFriends") return;
//if (bot.options.mode !== "savageFriends") return;
tryParsingMessage(message, {
players: bot.players,
getMessageAsPrismarine: bot.getMessageAsPrismarine,
chatType: "system",
chatType: "minecraft:system_chat",
});
});