mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2026-08-15 13:04:36 +00:00
1.20.6 - Not working yet
This commit is contained in:
parent
8270a2d9a3
commit
08c5c15557
17 changed files with 654 additions and 81 deletions
|
|
@ -31,9 +31,32 @@ namespace MinecraftClient.Protocol.Message
|
|||
|
||||
public static Dictionary<int, MessageType>? ChatId2Type;
|
||||
|
||||
// Used to store Chat Types in 1.20.6+
|
||||
public static void ReadChatType(Dictionary<int, string> data)
|
||||
{
|
||||
var chatTypeDictionary = ChatId2Type ?? new Dictionary<int, MessageType>();
|
||||
|
||||
foreach (var (chatId, chatName) in data)
|
||||
{
|
||||
chatTypeDictionary[chatId] = chatName switch
|
||||
{
|
||||
"minecraft:chat" => MessageType.CHAT,
|
||||
"minecraft:emote_command" => MessageType.EMOTE_COMMAND,
|
||||
"minecraft:msg_command_incoming" => MessageType.MSG_COMMAND_INCOMING,
|
||||
"minecraft:msg_command_outgoing" => MessageType.MSG_COMMAND_OUTGOING,
|
||||
"minecraft:say_command" => MessageType.SAY_COMMAND,
|
||||
"minecraft:team_msg_command_incoming" => MessageType.TEAM_MSG_COMMAND_INCOMING,
|
||||
"minecraft:team_msg_command_outgoing" => MessageType.TEAM_MSG_COMMAND_OUTGOING,
|
||||
_ => MessageType.CHAT,
|
||||
};
|
||||
}
|
||||
|
||||
ChatId2Type = chatTypeDictionary;
|
||||
}
|
||||
|
||||
public static void ReadChatType(Dictionary<string, object> registryCodec)
|
||||
{
|
||||
Dictionary<int, MessageType> chatTypeDictionary = ChatId2Type ?? new();
|
||||
var chatTypeDictionary = ChatId2Type ?? new Dictionary<int, MessageType>();
|
||||
var chatTypeListNbt =
|
||||
(object[])(((Dictionary<string, object>)registryCodec["minecraft:chat_type"])["value"]);
|
||||
foreach (var (chatName, chatId) in from Dictionary<string, object> chatTypeNbt in chatTypeListNbt
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue