Fixed a crash on 1.15.X, 1.14.X

This commit is contained in:
Anon 2023-03-25 21:24:15 +01:00
parent 8da8f6044f
commit 930fecde23
2 changed files with 2 additions and 8 deletions

View file

@ -618,8 +618,7 @@ namespace MinecraftClient.Protocol.Handlers
}
catch (KeyNotFoundException)
{
throw new System.IO.InvalidDataException("Unknown Metadata Type ID " + typeId +
". Is this up to date for new MC Version?");
throw new System.IO.InvalidDataException("Unknown Metadata Type ID " + typeId + ". Is this up to date for new MC Version?");
}
// Value's data type is depended on Type
@ -817,11 +816,6 @@ namespace MinecraftClient.Protocol.Handlers
if (protocolversion == Protocol18Handler.MC_1_17_Version || protocolversion == Protocol18Handler.MC_1_17_1_Version)
ReadDustParticleColorTransition(cache);
break;
case 20:
// 1.13 - 1.14.4
if (protocolversion < Protocol18Handler.MC_1_15_Version)
ReadNextVarInt(cache); // Block State (minecraft:falling_dust)
break;
case 23:
// 1.15 - 1.16.5
if (protocolversion >= Protocol18Handler.MC_1_15_Version && protocolversion < Protocol18Handler.MC_1_17_Version)

View file

@ -60,7 +60,7 @@ namespace MinecraftClient.Protocol.Handlers
p = new PacketPalette1122();
else if (protocol < Protocol18Handler.MC_1_14_Version)
p = new PacketPalette113();
else if (protocol <= Protocol18Handler.MC_1_15_Version)
else if (protocol < Protocol18Handler.MC_1_15_Version)
p = new PacketPalette114();
else if (protocol <= Protocol18Handler.MC_1_15_2_Version)
p = new PacketPalette115();