Fix 1.19.3 message signature issue

This commit is contained in:
BruceChen 2023-01-29 22:39:11 +08:00
parent 8cdd32a52a
commit 3735cab9dd
5 changed files with 52 additions and 16 deletions

View file

@ -2417,6 +2417,11 @@ namespace MinecraftClient
/// </summary>
public void OnGameJoined(bool isOnlineMode)
{
if (protocolversion < Protocol18Handler.MC_1_19_3_Version || playerKeyPair == null || !isOnlineMode)
SetCanSendMessage(true);
else
SetCanSendMessage(false);
string? bandString = Config.Main.Advanced.BrandInfo.ToBrandString();
if (!String.IsNullOrWhiteSpace(bandString))
handler.SendBrandInfo(bandString.Trim());
@ -2435,9 +2440,6 @@ namespace MinecraftClient
&& playerKeyPair != null && isOnlineMode)
handler.SendPlayerSession(playerKeyPair);
if (protocolversion < Protocol18Handler.MC_1_19_3_Version)
CanSendMessage = true;
if (inventoryHandlingRequested)
{
inventoryHandlingRequested = false;
@ -3482,9 +3484,10 @@ namespace MinecraftClient
ConsoleIO.OnAutoCompleteDone(transactionId, result);
}
public void OnDeclareCommands()
public void SetCanSendMessage(bool canSendMessage)
{
CanSendMessage = true;
CanSendMessage = canSendMessage;
Log.Debug("CanSendMessage = " + canSendMessage);
}
/// <summary>