fix mcc not showing the disconnect message

The fix is to remove the ParseText call from the OnConnectionLost call, as the ReadNextChat function already calls ParseText. Calling ParseText on an unparsable string returns an empty string, therefore the disconnect message never gets propagated to the user.
This commit is contained in:
breadbyte 2024-03-17 02:09:20 +08:00
parent 706a41ee26
commit dc71332dd3
2 changed files with 3 additions and 3 deletions

View file

@ -593,7 +593,7 @@ namespace MinecraftClient
ConsoleInteractive.ConsoleReader.StopReadThread();
ConsoleInteractive.ConsoleReader.MessageReceived -= ConsoleReaderOnMessageReceived;
ConsoleInteractive.ConsoleReader.OnInputChange -= ConsoleIO.AutocompleteHandler;
Program.HandleFailure(message, false, reason);
Program.HandleFailure(null, false, reason);
}
}

View file

@ -2045,7 +2045,7 @@ namespace MinecraftClient.Protocol.Handlers
return pForge.HandlePluginMessage(channel, packetData, ref currentDimension);
case PacketTypesIn.Disconnect:
handler.OnConnectionLost(ChatBot.DisconnectReason.InGameKick,
ChatParser.ParseText(dataTypes.ReadNextChat(packetData)));
dataTypes.ReadNextChat(packetData));
return false;
case PacketTypesIn.SetCompression:
if (protocolVersion is >= MC_1_8_Version and < MC_1_9_Version)