Fix empty NBT not getting handled correctly

#1011
This commit is contained in:
ReinforceZwei 2020-05-25 23:44:21 +08:00 committed by ORelio
parent 4362de4540
commit 65620e2e95

View file

@ -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)