diff --git a/MinecraftClient/Commands/Inventory.cs b/MinecraftClient/Commands/Inventory.cs
index eeeee3d0..5936afd0 100644
--- a/MinecraftClient/Commands/Inventory.cs
+++ b/MinecraftClient/Commands/Inventory.cs
@@ -435,6 +435,12 @@ namespace MinecraftClient.Commands
return r.SetAndReturn(CmdResult.Status.Fail, msg);
}
+ if (container.Type != ContainerType.PlayerInventory)
+ {
+ handler.Log.Warn(string.Format(Translations.cmd_inventory_tui_unsupported_container, inventoryId));
+ return r.SetAndReturn(CmdResult.Status.Fail);
+ }
+
handler.Log.Info(string.Format(Translations.cmd_inventory_tui_opening, inventoryId));
bool success = InventoryTuiHost.Launch(handler, inventoryId);
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
diff --git a/MinecraftClient/Resources/Translations/Translations.Designer.cs b/MinecraftClient/Resources/Translations/Translations.Designer.cs
index 10fddca1..d20d36af 100644
--- a/MinecraftClient/Resources/Translations/Translations.Designer.cs
+++ b/MinecraftClient/Resources/Translations/Translations.Designer.cs
@@ -6332,6 +6332,15 @@ namespace MinecraftClient {
}
}
+ ///
+ /// Looks up a localized string similar to TUI viewer does not support this container type (Inventory #{0}). Use '/inventory {0} list' to view its contents..
+ ///
+ internal static string cmd_inventory_tui_unsupported_container {
+ get {
+ return ResourceManager.GetString("cmd.inventory.tui_unsupported_container", resourceCulture);
+ }
+ }
+
///
/// Looks up a localized string similar to Hold Shift + Left-click to select and copy text..
///
diff --git a/MinecraftClient/Resources/Translations/Translations.resx b/MinecraftClient/Resources/Translations/Translations.resx
index a877ef80..5eb2fa76 100644
--- a/MinecraftClient/Resources/Translations/Translations.resx
+++ b/MinecraftClient/Resources/Translations/Translations.resx
@@ -2229,6 +2229,9 @@ Logging in...
Failed to launch TUI inventory viewer.
+
+ TUI viewer does not support this container type (Inventory #{0}). Use '/inventory {0} list' to view its contents.
+
Hold Shift + Left-click to select and copy text.