bugfix: Fixed a non-existant configuration packet from crashing the client.

This commit is contained in:
Anon 2026-04-07 18:25:43 +02:00 committed by GitHub
commit 756bc1e11f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -467,7 +467,19 @@ namespace MinecraftClient.Protocol.Handlers
// https://wiki.vg/Protocol#Configuration
case CurrentState.Configuration:
switch (packetPalette.GetIncomingConfigurationTypeById(packetId))
if (!packetPalette.GetMappingInConfiguration().TryGetValue(packetId, out var configurationPacketType))
{
if (packetPalette.GetMappingIn().ContainsKey(packetId))
{
currentState = CurrentState.Play;
return HandlePlayPackets(packetId, packetData);
}
throw new KeyNotFoundException("Configuration Packet ID of 0x" + packetId.ToString("X2") +
" doesn't exist!");
}
switch (configurationPacketType)
{
case ConfigurationPacketTypesIn.CookieRequest:
var cookieName = dataTypes.ReadNextString(packetData);