Merge pull request #33 from vfrz/master
Fixed bug where top-level compound tags without a name would be skipped by the TagWriter.
This commit is contained in:
commit
bd80810e2c
|
@ -306,7 +306,10 @@ public class TagWriter : TagIO
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||||
private void WriteTypeAndName(Tag tag)
|
private void WriteTypeAndName(Tag tag)
|
||||||
{
|
{
|
||||||
if (tag.Parent is ListTag || string.IsNullOrEmpty(tag.Name))
|
if (tag.Parent is ListTag)
|
||||||
|
return;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(tag.Name) && !(tag is CompoundTag && tag.Parent is null))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BaseStream.WriteByte((byte) tag.Type);
|
BaseStream.WriteByte((byte) tag.Type);
|
||||||
|
@ -384,4 +387,4 @@ public class TagWriter : TagIO
|
||||||
else
|
else
|
||||||
BaseStream.Write(GetBytes(count), 0, sizeof(int));
|
BaseStream.Write(GetBytes(count), 0, sizeof(int));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue