Skip to content

Commit

Permalink
Fix TagWriter type and name writing
Browse files Browse the repository at this point in the history
  • Loading branch information
NotroDev committed Jun 26, 2024
1 parent 795aa86 commit 63c8d08
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions SharpNBT/TagWriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,10 @@ private void WriteTypeAndName(Tag tag)
if (tag.Parent is ListTag)

Check warning on line 309 in SharpNBT/TagWriter.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0.x

'Tag.Parent' is obsolete: 'Parent property may be removed in a future version.'
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);
if (!string.IsNullOrEmpty(tag.Name) || tag.Parent is not null)

Check warning on line 314 in SharpNBT/TagWriter.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0.x

'Tag.Parent' is obsolete: 'Parent property may be removed in a future version.'
WriteUTF8String(tag.Name);

Check warning on line 315 in SharpNBT/TagWriter.cs

View workflow job for this annotation

GitHub Actions / .NET 7.0.x

Possible null reference argument for parameter 'value' in 'void TagWriter.WriteUTF8String(string value)'.
}

[MethodImpl(MethodImplOptions.AggressiveInlining)]
Expand Down

0 comments on commit 63c8d08

Please sign in to comment.