mirror of
https://github.com/MCCTeam/Minecraft-Console-Client
synced 2025-10-14 21:22:49 +00:00
Upgrade protocol to 1.19.3
This commit is contained in:
parent
f3b50738f1
commit
657fc6117b
4 changed files with 41 additions and 32 deletions
|
|
@ -44,7 +44,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.19.2";
|
public const string MCHighestVersion = "1.19.3";
|
||||||
public static readonly string? BuildInfo = null;
|
public static readonly string? BuildInfo = null;
|
||||||
|
|
||||||
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;
|
private static Tuple<Thread, CancellationTokenSource>? offlinePrompt = null;
|
||||||
|
|
@ -621,6 +621,10 @@ namespace MinecraftClient
|
||||||
{
|
{
|
||||||
HandleFailure(Translations.error_unsupported, true);
|
HandleFailure(Translations.error_unsupported, true);
|
||||||
}
|
}
|
||||||
|
catch (NotImplementedException)
|
||||||
|
{
|
||||||
|
throw;
|
||||||
|
}
|
||||||
catch (Exception) { }
|
catch (Exception) { }
|
||||||
}
|
}
|
||||||
else HandleFailure(Translations.error_determine, true);
|
else HandleFailure(Translations.error_determine, true);
|
||||||
|
|
|
||||||
|
|
@ -30,7 +30,7 @@ namespace MinecraftClient.Protocol.Handlers.PacketPalettes
|
||||||
{ 0x15, PacketTypesIn.PluginMessage }, // (Wiki name: Plugin Message (clientbound))
|
{ 0x15, PacketTypesIn.PluginMessage }, // (Wiki name: Plugin Message (clientbound))
|
||||||
{ 0x16, PacketTypesIn.HideMessage }, // Added in 1.19.1
|
{ 0x16, PacketTypesIn.HideMessage }, // Added in 1.19.1
|
||||||
{ 0x17, PacketTypesIn.Disconnect }, //
|
{ 0x17, PacketTypesIn.Disconnect }, //
|
||||||
{ 0x18, PacketTypesIn.ProfilelessChatMessage }, // Added in 1.19.3 - TODO
|
{ 0x18, PacketTypesIn.ProfilelessChatMessage }, // Added in 1.19.3 (Wiki name: Disguised Chat Message)
|
||||||
{ 0x19, PacketTypesIn.EntityStatus }, // (Wiki name: Entity Event)
|
{ 0x19, PacketTypesIn.EntityStatus }, // (Wiki name: Entity Event)
|
||||||
{ 0x1A, PacketTypesIn.Explosion }, // Changed in 1.19 (Location fields are now Double instead of Float) (Wiki name: Explosion)
|
{ 0x1A, PacketTypesIn.Explosion }, // Changed in 1.19 (Location fields are now Double instead of Float) (Wiki name: Explosion)
|
||||||
{ 0x1B, PacketTypesIn.UnloadChunk }, // (Wiki name: Forget Chunk)
|
{ 0x1B, PacketTypesIn.UnloadChunk }, // (Wiki name: Forget Chunk)
|
||||||
|
|
@ -123,33 +123,33 @@ namespace MinecraftClient.Protocol.Handlers.PacketPalettes
|
||||||
{ 0x03, PacketTypesOut.MessageAcknowledgment }, // Added in 1.19.1
|
{ 0x03, PacketTypesOut.MessageAcknowledgment }, // Added in 1.19.1
|
||||||
{ 0x04, PacketTypesOut.ChatCommand }, // Added in 1.19
|
{ 0x04, PacketTypesOut.ChatCommand }, // Added in 1.19
|
||||||
{ 0x05, PacketTypesOut.ChatMessage }, // Changed in 1.19 (Completely changed) (Wiki name: Chat)
|
{ 0x05, PacketTypesOut.ChatMessage }, // Changed in 1.19 (Completely changed) (Wiki name: Chat)
|
||||||
{ 0x06, PacketTypesOut.ChatPreview }, // Added in 1.19 (Wiki name: Chat Preview (serverbound))
|
{ 0x06, PacketTypesOut.ClientStatus }, // (Wiki name: Client Command)
|
||||||
{ 0x07, PacketTypesOut.ClientStatus }, // (Wiki name: Client Command)
|
{ 0x07, PacketTypesOut.ClientSettings }, // (Wiki name: Client Information)
|
||||||
{ 0x08, PacketTypesOut.ClientSettings }, // (Wiki name: Client Information)
|
{ 0x08, PacketTypesOut.TabComplete }, // (Wiki name: Command Suggestions Request)
|
||||||
{ 0x09, PacketTypesOut.TabComplete }, // (Wiki name: Command Suggestions Request)
|
{ 0x09, PacketTypesOut.ClickWindowButton }, // (Wiki name: Click Container Button)
|
||||||
{ 0x0A, PacketTypesOut.ClickWindowButton }, // (Wiki name: Click Container Button)
|
{ 0x0A, PacketTypesOut.ClickWindow }, // (Wiki name: Click Container)
|
||||||
{ 0x0B, PacketTypesOut.ClickWindow }, // (Wiki name: Click Container)
|
{ 0x0B, PacketTypesOut.CloseWindow }, // (Wiki name: Close Container (serverbound))
|
||||||
{ 0x0C, PacketTypesOut.CloseWindow }, // (Wiki name: Close Container (serverbound))
|
{ 0x0C, PacketTypesOut.PluginMessage }, // (Wiki name: Plugin Message (serverbound))
|
||||||
{ 0x0D, PacketTypesOut.PluginMessage }, // (Wiki name: Plugin Message (serverbound))
|
{ 0x0D, PacketTypesOut.EditBook }, //
|
||||||
{ 0x0E, PacketTypesOut.EditBook }, //
|
{ 0x0E, PacketTypesOut.EntityNBTRequest }, // (Wiki name: Query Entity Tag)
|
||||||
{ 0x0F, PacketTypesOut.EntityNBTRequest }, // (Wiki name: Query Entity Tag)
|
{ 0x0F, PacketTypesOut.InteractEntity }, // (Wiki name: Interact)
|
||||||
{ 0x10, PacketTypesOut.InteractEntity }, // (Wiki name: Interact)
|
{ 0x10, PacketTypesOut.GenerateStructure }, // (Wiki name: Jigsaw Generate)
|
||||||
{ 0x11, PacketTypesOut.GenerateStructure }, // (Wiki name: Jigsaw Generate)
|
{ 0x11, PacketTypesOut.KeepAlive }, //
|
||||||
{ 0x12, PacketTypesOut.KeepAlive }, //
|
{ 0x12, PacketTypesOut.LockDifficulty }, //
|
||||||
{ 0x13, PacketTypesOut.LockDifficulty }, //
|
{ 0x13, PacketTypesOut.PlayerPosition }, // (Wiki name: Move Player Position)
|
||||||
{ 0x14, PacketTypesOut.PlayerPosition }, // (Wiki name: Move Player Position)
|
{ 0x14, PacketTypesOut.PlayerPositionAndRotation }, // (Wiki name: Set Player Position and Rotation)
|
||||||
{ 0x15, PacketTypesOut.PlayerPositionAndRotation }, // (Wiki name: Set Player Position and Rotation)
|
{ 0x15, PacketTypesOut.PlayerRotation }, // (Wiki name: Set Player Rotation)
|
||||||
{ 0x16, PacketTypesOut.PlayerRotation }, // (Wiki name: Set Player Rotation)
|
{ 0x16, PacketTypesOut.PlayerMovement }, // (Wiki name: Set Player On Ground)
|
||||||
{ 0x17, PacketTypesOut.PlayerMovement }, // (Wiki name: Set Player On Ground)
|
{ 0x17, PacketTypesOut.VehicleMove }, // (Wiki name: Move Vehicle (serverbound))
|
||||||
{ 0x18, PacketTypesOut.VehicleMove }, // (Wiki name: Move Vehicle (serverbound))
|
{ 0x18, PacketTypesOut.SteerBoat }, // (Wiki name: Paddle Boat)
|
||||||
{ 0x19, PacketTypesOut.SteerBoat }, // (Wiki name: Paddle Boat)
|
{ 0x19, PacketTypesOut.PickItem }, //
|
||||||
{ 0x1A, PacketTypesOut.PickItem }, //
|
{ 0x1A, PacketTypesOut.CraftRecipeRequest }, // (Wiki name: Place recipe)
|
||||||
{ 0x1B, PacketTypesOut.CraftRecipeRequest }, // (Wiki name: Place recipe)
|
{ 0x1B, PacketTypesOut.PlayerAbilities }, //
|
||||||
{ 0x1C, PacketTypesOut.PlayerAbilities }, //
|
{ 0x1C, PacketTypesOut.PlayerDigging }, // Changed in 1.19 (Added a "Sequence" field) (Wiki name: Player Action)
|
||||||
{ 0x1D, PacketTypesOut.PlayerDigging }, // Changed in 1.19 (Added a "Sequence" field) (Wiki name: Player Action)
|
{ 0x1D, PacketTypesOut.EntityAction }, // (Wiki name: Player Command)
|
||||||
{ 0x1E, PacketTypesOut.EntityAction }, // (Wiki name: Player Command)
|
{ 0x1E, PacketTypesOut.SteerVehicle }, // (Wiki name: Player Input)
|
||||||
{ 0x1F, PacketTypesOut.SteerVehicle }, // (Wiki name: Player Input)
|
{ 0x1F, PacketTypesOut.Pong }, // (Wiki name: Pong (play))
|
||||||
{ 0x20, PacketTypesOut.Pong }, // (Wiki name: Pong (play))
|
{ 0x20, PacketTypesOut.PlayerSession }, // Added in 1.19.3
|
||||||
{ 0x21, PacketTypesOut.SetDisplayedRecipe }, // (Wiki name: Recipe Book Change Settings)
|
{ 0x21, PacketTypesOut.SetDisplayedRecipe }, // (Wiki name: Recipe Book Change Settings)
|
||||||
{ 0x22, PacketTypesOut.SetRecipeBookState }, // (Wiki name: Recipe Book Seen Recipe)
|
{ 0x22, PacketTypesOut.SetRecipeBookState }, // (Wiki name: Recipe Book Seen Recipe)
|
||||||
{ 0x23, PacketTypesOut.NameItem }, // (Wiki name: Rename Item)
|
{ 0x23, PacketTypesOut.NameItem }, // (Wiki name: Rename Item)
|
||||||
|
|
|
||||||
|
|
@ -47,7 +47,7 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
public PacketTypePalette GetTypeHandler(int protocol)
|
public PacketTypePalette GetTypeHandler(int protocol)
|
||||||
{
|
{
|
||||||
PacketTypePalette p;
|
PacketTypePalette p;
|
||||||
if (protocol > Protocol18Handler.MC_1_19_2_Version)
|
if (protocol > Protocol18Handler.MC_1_19_3_Version)
|
||||||
throw new NotImplementedException(Translations.exception_palette_packet);
|
throw new NotImplementedException(Translations.exception_palette_packet);
|
||||||
|
|
||||||
if (protocol <= Protocol18Handler.MC_1_8_Version)
|
if (protocol <= Protocol18Handler.MC_1_8_Version)
|
||||||
|
|
@ -74,8 +74,10 @@ namespace MinecraftClient.Protocol.Handlers
|
||||||
p = new PacketPalette118();
|
p = new PacketPalette118();
|
||||||
else if (protocol <= Protocol18Handler.MC_1_19_Version)
|
else if (protocol <= Protocol18Handler.MC_1_19_Version)
|
||||||
p = new PacketPalette119();
|
p = new PacketPalette119();
|
||||||
else
|
else if (protocol <= Protocol18Handler.MC_1_19_2_Version)
|
||||||
p = new PacketPalette1192();
|
p = new PacketPalette1192();
|
||||||
|
else
|
||||||
|
p = new PacketPalette1193();
|
||||||
|
|
||||||
p.SetForgeEnabled(forgeEnabled);
|
p.SetForgeEnabled(forgeEnabled);
|
||||||
return p;
|
return p;
|
||||||
|
|
|
||||||
|
|
@ -134,7 +134,7 @@ namespace MinecraftClient.Protocol
|
||||||
if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1)
|
if (Array.IndexOf(supportedVersions_Protocol16, ProtocolVersion) > -1)
|
||||||
return new Protocol16Handler(Client, ProtocolVersion, Handler);
|
return new Protocol16Handler(Client, ProtocolVersion, Handler);
|
||||||
|
|
||||||
int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573, 575, 578, 735, 736, 751, 753, 754, 755, 756, 757, 758, 759, 760 };
|
int[] supportedVersions_Protocol18 = { 4, 5, 47, 107, 108, 109, 110, 210, 315, 316, 335, 338, 340, 393, 401, 404, 477, 480, 485, 490, 498, 573, 575, 578, 735, 736, 751, 753, 754, 755, 756, 757, 758, 759, 760, 761 };
|
||||||
|
|
||||||
if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1)
|
if (Array.IndexOf(supportedVersions_Protocol18, ProtocolVersion) > -1)
|
||||||
return new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo);
|
return new Protocol18Handler(Client, ProtocolVersion, Handler, forgeInfo);
|
||||||
|
|
@ -313,6 +313,8 @@ namespace MinecraftClient.Protocol
|
||||||
case "1.19.1":
|
case "1.19.1":
|
||||||
case "1.19.2":
|
case "1.19.2":
|
||||||
return 760;
|
return 760;
|
||||||
|
case "1.19.3":
|
||||||
|
return 761;
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -389,6 +391,7 @@ namespace MinecraftClient.Protocol
|
||||||
case 758: return "1.18.2";
|
case 758: return "1.18.2";
|
||||||
case 759: return "1.19";
|
case 759: return "1.19";
|
||||||
case 760: return "1.19.2";
|
case 760: return "1.19.2";
|
||||||
|
case 761: return "1.19.3";
|
||||||
default: return "0.0";
|
default: return "0.0";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue