Update to MC version 1.16.5 (#1417)

* Update to MC version 1.16.5

* Remove comments about protocol number
This commit is contained in:
ReinforceZwei 2021-01-16 21:33:40 +08:00 committed by GitHub
parent f20abb6fbc
commit 0cbe543c30
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 12 additions and 9 deletions

View file

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

View file

@ -39,7 +39,7 @@ namespace MinecraftClient.Protocol.Handlers
/// <returns></returns> /// <returns></returns>
public PacketTypePalette GetTypeHandler(int protocol) public PacketTypePalette GetTypeHandler(int protocol)
{ {
if (protocol > Protocol18Handler.MC1164Version) if (protocol > Protocol18Handler.MC1165Version)
throw new NotImplementedException(Translations.Get("exception.palette.packet")); throw new NotImplementedException(Translations.Get("exception.palette.packet"));
if (protocol <= Protocol18Handler.MC18Version) if (protocol <= Protocol18Handler.MC18Version)
return new PacketPalette17(); return new PacketPalette17();

View file

@ -47,7 +47,7 @@ namespace MinecraftClient.Protocol.Handlers
internal const int MC1161Version = 736; internal const int MC1161Version = 736;
internal const int MC1162Version = 751; internal const int MC1162Version = 751;
internal const int MC1163Version = 753; internal const int MC1163Version = 753;
internal const int MC1164Version = 754; internal const int MC1165Version = 754;
private int compression_treshold = 0; private int compression_treshold = 0;
private bool autocomplete_received = false; private bool autocomplete_received = false;
@ -80,19 +80,19 @@ namespace MinecraftClient.Protocol.Handlers
this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler); this.pTerrain = new Protocol18Terrain(protocolVersion, dataTypes, handler);
this.packetPalette = new PacketTypeHandler(protocolVersion).GetTypeHandler(); this.packetPalette = new PacketTypeHandler(protocolVersion).GetTypeHandler();
if (handler.GetTerrainEnabled() && protocolversion > MC1164Version) if (handler.GetTerrainEnabled() && protocolversion > MC1165Version)
{ {
Translations.WriteLineFormatted("extra.terrainandmovement_disabled"); Translations.WriteLineFormatted("extra.terrainandmovement_disabled");
handler.SetTerrainEnabled(false); handler.SetTerrainEnabled(false);
} }
if (handler.GetInventoryEnabled() && (protocolversion < MC110Version || protocolversion > MC1164Version)) if (handler.GetInventoryEnabled() && (protocolversion < MC110Version || protocolversion > MC1165Version))
{ {
Translations.WriteLineFormatted("extra.inventory_disabled"); Translations.WriteLineFormatted("extra.inventory_disabled");
handler.SetInventoryEnabled(false); handler.SetInventoryEnabled(false);
} }
if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1164Version)) if (handler.GetEntityHandlingEnabled() && (protocolversion < MC110Version || protocolversion > MC1165Version))
{ {
Translations.WriteLineFormatted("extra.entity_disabled"); Translations.WriteLineFormatted("extra.entity_disabled");
handler.SetEntityHandlingEnabled(false); handler.SetEntityHandlingEnabled(false);
@ -101,7 +101,7 @@ namespace MinecraftClient.Protocol.Handlers
// Block palette // Block palette
if (protocolversion >= MC113Version) if (protocolversion >= MC113Version)
{ {
if (protocolVersion > MC1164Version && handler.GetTerrainEnabled()) if (protocolVersion > MC1165Version && handler.GetTerrainEnabled())
throw new NotImplementedException(Translations.Get("exception.palette.block")); throw new NotImplementedException(Translations.Get("exception.palette.block"));
if (protocolVersion >= MC116Version) if (protocolVersion >= MC116Version)
Block.Palette = new Palette116(); Block.Palette = new Palette116();
@ -116,7 +116,7 @@ namespace MinecraftClient.Protocol.Handlers
// Entity palette // Entity palette
if (protocolversion >= MC113Version) if (protocolversion >= MC113Version)
{ {
if (protocolversion > MC1164Version && handler.GetEntityHandlingEnabled()) if (protocolversion > MC1165Version && handler.GetEntityHandlingEnabled())
throw new NotImplementedException(Translations.Get("exception.palette.entity")); throw new NotImplementedException(Translations.Get("exception.palette.entity"));
if (protocolversion >= MC1162Version) if (protocolversion >= MC1162Version)
entityPalette = new EntityPalette1162(); entityPalette = new EntityPalette1162();
@ -133,7 +133,7 @@ namespace MinecraftClient.Protocol.Handlers
// Item palette // Item palette
if (protocolversion >= MC116Version) if (protocolversion >= MC116Version)
{ {
if (protocolversion > MC1164Version && handler.GetInventoryEnabled()) if (protocolversion > MC1165Version && handler.GetInventoryEnabled())
throw new NotImplementedException(Translations.Get("exception.palette.item")); throw new NotImplementedException(Translations.Get("exception.palette.item"));
if (protocolversion >= MC1162Version) if (protocolversion >= MC1162Version)
itemPalette = new ItemPalette1162(); itemPalette = new ItemPalette1162();

View file

@ -243,6 +243,7 @@ namespace MinecraftClient.Protocol
case "1.16.3": case "1.16.3":
return 753; return 753;
case "1.16.4": case "1.16.4":
case "1.16.5":
return 754; return 754;
default: default:
return 0; return 0;
@ -303,6 +304,8 @@ namespace MinecraftClient.Protocol
case 735: return "1.16"; case 735: return "1.16";
case 736: return "1.16.1"; case 736: return "1.16.1";
case 751: return "1.16.2"; case 751: return "1.16.2";
case 753: return "1.16.3";
case 754: return "1.16.5";
default: return "0.0"; default: return "0.0";
} }
} }