From 94a997220648bf54e50b31953fc98b45eecf9bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Herv=C3=A9=20BECHER?= Date: Fri, 15 Mar 2024 23:47:53 +0100 Subject: [PATCH] Make indent configurable --- Nbt/Serialization/SNbt.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Nbt/Serialization/SNbt.cs b/Nbt/Serialization/SNbt.cs index 9e604b8..1514d9f 100755 --- a/Nbt/Serialization/SNbt.cs +++ b/Nbt/Serialization/SNbt.cs @@ -17,6 +17,7 @@ public static class SNbt public static readonly SerializerOptions Default = new(); public SerializationStyle Style { get; init; } = SerializationStyle.Compact; + public string Indent { get; init; } = " "; public bool AlwaysQuoteTagNames { get; init; } = false; // public bool AlwaysQuoteStringTags { get; init; } = false; } @@ -101,7 +102,7 @@ public static class SNbt { for (var i = 0u; i < depth; i++) { - writer.Write(" "); + writer.Write(options.Indent); } }