feat: enhance Protocol18 and SocketWrapper for improved functionality

- Added support for the new world border hit flag in Protocol18 for protocol version 1.21.2.
- Updated SocketWrapper to throw a SocketException if SendDataRAW is called when not connected, improving error handling.

These changes enhance the protocol handling and error management in the Minecraft Console Client.
This commit is contained in:
BruceChen 2026-03-26 02:35:43 +08:00
parent 8456e363f5
commit dcfff3f1ba
2 changed files with 8 additions and 2 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using System.Net.Sockets;
using MinecraftClient.Crypto;
@ -90,6 +90,9 @@ namespace MinecraftClient.Protocol.Handlers
/// <param name="buffer">data to send</param>
public void SendDataRAW(byte[] buffer)
{
if (!IsConnected())
throw new SocketException((int)SocketError.NotConnected);
if (encrypted)
s!.Write(buffer, 0, buffer.Length);
else