Update version to 1.18 (#1836)

This commit is contained in:
ReinforceZwei 2021-12-02 21:07:57 +08:00 committed by GitHub
parent 6918a64c47
commit 9a9245f193
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 194 additions and 5 deletions

View file

@ -52,6 +52,7 @@ namespace MinecraftClient.Protocol.Handlers
internal const int MC1165Version = 754;
internal const int MC117Version = 755;
internal const int MC1171Version = 756;
internal const int MC118Version = 757;
private int compression_treshold = 0;
private bool autocomplete_received = false;
@ -325,6 +326,8 @@ namespace MinecraftClient.Protocol.Handlers
dataTypes.ReadNextString(packetData); // Level Type - 1.15 and below
if (protocolversion >= MC114Version)
dataTypes.ReadNextVarInt(packetData); // View distance - 1.14 and above
if (protocolversion >= MC118Version)
dataTypes.ReadNextVarInt(packetData); // Simulation Distance - 1.18 and above
if (protocolversion >= MC18Version)
dataTypes.ReadNextBool(packetData); // Reduced debug info - 1.8 and above
if (protocolversion >= MC115Version)
@ -1609,7 +1612,9 @@ namespace MinecraftClient.Protocol.Handlers
if (protocolversion >= MC19Version)
fields.AddRange(dataTypes.GetVarInt(mainHand));
if (protocolversion >= MC117Version)
fields.Add(1);
fields.Add(0); // Enables text filtering. Always false
if (protocolversion >= MC118Version)
fields.Add(1); // 1.18 and above - Allow server listings
SendPacket(PacketTypesOut.ClientSettings, fields);
}
catch (SocketException) { }