diff --git a/MinecraftClient/Protocol/Handlers/Protocol18.cs b/MinecraftClient/Protocol/Handlers/Protocol18.cs index 84c7baac..b9128587 100644 --- a/MinecraftClient/Protocol/Handlers/Protocol18.cs +++ b/MinecraftClient/Protocol/Handlers/Protocol18.cs @@ -4587,7 +4587,10 @@ namespace MinecraftClient.Protocol.Handlers if(protocolVersion >= MC_1_14_Version) packet.Add(0); // insideBlock = false - + + if (protocolVersion >= MC_1_21_2_Version) + packet.Add(0); // worldBorderHit = false + if (protocolVersion >= MC_1_19_Version) packet.AddRange(DataTypes.GetVarInt(sequenceId)); diff --git a/MinecraftClient/Protocol/Handlers/SocketWrapper.cs b/MinecraftClient/Protocol/Handlers/SocketWrapper.cs index 338bcd46..a4f451b1 100644 --- a/MinecraftClient/Protocol/Handlers/SocketWrapper.cs +++ b/MinecraftClient/Protocol/Handlers/SocketWrapper.cs @@ -1,4 +1,4 @@ -using System; +using System; using System.Net.Sockets; using MinecraftClient.Crypto; @@ -90,6 +90,9 @@ namespace MinecraftClient.Protocol.Handlers /// data to send public void SendDataRAW(byte[] buffer) { + if (!IsConnected()) + throw new SocketException((int)SocketError.NotConnected); + if (encrypted) s!.Write(buffer, 0, buffer.Length); else