diff --git a/MinecraftClient/Protocol/Handlers/DataTypes.cs b/MinecraftClient/Protocol/Handlers/DataTypes.cs index 489eb405..3b8c36fa 100644 --- a/MinecraftClient/Protocol/Handlers/DataTypes.cs +++ b/MinecraftClient/Protocol/Handlers/DataTypes.cs @@ -324,16 +324,18 @@ namespace MinecraftClient.Protocol.Handlers /// private Dictionary ReadNextNbt(List cache, bool root) { + Dictionary NbtData = new Dictionary(); + if (root) { + if (cache[0] == 0) // TAG_End + return NbtData; if (cache[0] != 10) // TAG_Compound throw new System.IO.InvalidDataException("Failed to decode NBT: Does not start with TAG_Compound"); ReadNextByte(cache); // Tag type (TAG_Compound) ReadData(ReadNextUShort(cache), cache); // NBT root name } - Dictionary NbtData = new Dictionary(); - while (true) { int fieldType = ReadNextByte(cache);