diff --git a/MinecraftClient/McClient.cs b/MinecraftClient/McClient.cs index e61d2350..d4c8a739 100644 --- a/MinecraftClient/McClient.cs +++ b/MinecraftClient/McClient.cs @@ -2434,7 +2434,9 @@ namespace MinecraftClient if (protocolversion >= Protocol18Handler.MC_1_19_3_Version && playerKeyPair != null) handler.SendPlayerSession(playerKeyPair); - CanSendMessage = true; + + if (protocolversion < Protocol18Handler.MC_1_19_3_Version) + CanSendMessage = true; if (inventoryHandlingRequested) { @@ -3480,6 +3482,11 @@ namespace MinecraftClient ConsoleIO.OnAutoCompleteDone(transactionId, result); } + public void OnDeclareCommands() + { + CanSendMessage = true; + } + /// /// Send a click container button packet to the server. /// Used for Enchanting table, Lectern, stone cutter and loom diff --git a/MinecraftClient/Protocol/Handlers/Packet/s2c/DeclareCommands.cs b/MinecraftClient/Protocol/Handlers/Packet/s2c/DeclareCommands.cs index 245432bc..b2a9600c 100644 --- a/MinecraftClient/Protocol/Handlers/Packet/s2c/DeclareCommands.cs +++ b/MinecraftClient/Protocol/Handlers/Packet/s2c/DeclareCommands.cs @@ -104,9 +104,6 @@ namespace MinecraftClient.Protocol.Handlers.packet.s2c private static void CollectSignArguments(int NodeIdx, string command, List> arguments) { - if (Nodes.Length <= NodeIdx) - return; - CommandNode node = Nodes[NodeIdx]; string last_arg = command; switch (node.Flags & 0x03) diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 745245f9..39f0ed18 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -466,7 +466,10 @@ namespace MinecraftClient.Protocol.Handlers break; case PacketTypesIn.DeclareCommands: if (protocolVersion >= MC_1_19_Version) + { DeclareCommands.Read(dataTypes, packetData, protocolVersion); + handler.OnDeclareCommands(); + } break; case PacketTypesIn.ChatMessage: int messageType = 0; diff --git a/MinecraftClient/Protocol/IMinecraftComHandler.cs b/MinecraftClient/Protocol/IMinecraftComHandler.cs index e128507d..1adc9d65 100644 --- a/MinecraftClient/Protocol/IMinecraftComHandler.cs +++ b/MinecraftClient/Protocol/IMinecraftComHandler.cs @@ -466,6 +466,8 @@ namespace MinecraftClient.Protocol /// All commands. public void OnAutoCompleteDone(int transactionId, string[] result); + public void OnDeclareCommands(); + /// /// Send a click container button packet to the server. /// Used for Enchanting table, Lectern, stone cutter and loom