From 65620e2e95247b464d981fb19f73479481ce0c2c Mon Sep 17 00:00:00 2001 From: ReinforceZwei Date: Mon, 25 May 2020 23:44:21 +0800 Subject: [PATCH] Fix empty NBT not getting handled correctly #1011 --- MinecraftClient/Protocol/Handlers/DataTypes.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/MinecraftClient/Protocol/Handlers/DataTypes.cs b/MinecraftClient/Protocol/Handlers/DataTypes.cs index bad87456..b808a1f4 100644 --- a/MinecraftClient/Protocol/Handlers/DataTypes.cs +++ b/MinecraftClient/Protocol/Handlers/DataTypes.cs @@ -403,7 +403,10 @@ namespace MinecraftClient.Protocol.Handlers if (root) { if (cache.Peek() == 0) // TAG_End + { + cache.Dequeue(); return NbtData; + } if (cache.Peek() != 10) // TAG_Compound throw new System.IO.InvalidDataException("Failed to decode NBT: Does not start with TAG_Compound"); ReadNextByte(cache); // Tag type (TAG_Compound)