Allow empty name only for root compound tag
This commit is contained in:
parent
7f020e1c51
commit
ad4dcf63f3
|
@ -309,6 +309,9 @@ public class TagWriter : TagIO
|
||||||
if (tag.Parent is ListTag)
|
if (tag.Parent is ListTag)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (string.IsNullOrEmpty(tag.Name) && !(tag is CompoundTag && tag.Parent is null))
|
||||||
|
return;
|
||||||
|
|
||||||
BaseStream.WriteByte((byte) tag.Type);
|
BaseStream.WriteByte((byte) tag.Type);
|
||||||
WriteUTF8String(tag.Name);
|
WriteUTF8String(tag.Name);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue