Update version to 1.18.1 (#1845)

This commit is contained in:
ReinforceZwei 2021-12-10 22:15:00 +08:00 committed by GitHub
parent fdc3069083
commit bdcf3e5aa2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 6 deletions

View file

@ -32,7 +32,7 @@ namespace MinecraftClient
public const string Version = MCHighestVersion;
public const string MCLowestVersion = "1.4.6";
public const string MCHighestVersion = "1.18";
public const string MCHighestVersion = "1.18.1";
public static readonly string BuildInfo = null;
private static Thread offlinePrompt = null;

View file

@ -51,7 +51,7 @@ namespace MinecraftClient.Protocol.Handlers
public PacketTypePalette GetTypeHandler(int protocol)
{
PacketTypePalette p;
if (protocol > Protocol18Handler.MC118Version)
if (protocol > Protocol18Handler.MC1181Version)
throw new NotImplementedException(Translations.Get("exception.palette.packet"));
if (protocol <= Protocol18Handler.MC18Version)
p = new PacketPalette17();

View file

@ -52,7 +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;
internal const int MC1181Version = 757;
private int compression_treshold = 0;
private bool autocomplete_received = false;
@ -326,7 +326,7 @@ 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)
if (protocolversion >= MC1181Version)
dataTypes.ReadNextVarInt(packetData); // Simulation Distance - 1.18 and above
if (protocolversion >= MC18Version)
dataTypes.ReadNextBool(packetData); // Reduced debug info - 1.8 and above
@ -1613,7 +1613,7 @@ namespace MinecraftClient.Protocol.Handlers
fields.AddRange(dataTypes.GetVarInt(mainHand));
if (protocolversion >= MC117Version)
fields.Add(0); // Enables text filtering. Always false
if (protocolversion >= MC118Version)
if (protocolversion >= MC1181Version)
fields.Add(1); // 1.18 and above - Allow server listings
SendPacket(PacketTypesOut.ClientSettings, fields);
}

View file

@ -251,6 +251,7 @@ namespace MinecraftClient.Protocol
case "1.17.1":
return 756;
case "1.18":
case "1.18.1":
return 757;
default:
return 0;
@ -315,7 +316,7 @@ namespace MinecraftClient.Protocol
case 754: return "1.16.5";
case 755: return "1.17";
case 756: return "1.17.1";
case 757: return "1.18";
case 757: return "1.18.1";
default: return "0.0";
}
}