public static NbtCompound AsCompound(this NbTag tag, Utf8String tagName, Utf8String?compoundName = null) { if (tag == null) { throw new ArgumentNullException(nameof(tag)); } return(new NbtCompound(compoundName).Add(tagName, tag)); }
public static void Write(this NetBinaryWriter writer, NbTag tag) { if (tag == null) { throw new ArgumentNullException(nameof(tag)); } tag.WriteHeader(writer, NbtFlags.TypedNamed); tag.WritePayload(writer, NbtFlags.TypedNamed); }