11[ ![ Build status] ( https://ci.appveyor.com/api/projects/status/vcdkhya4u6h26qr2/branch/master?svg=true )] ( https://ci.appveyor.com/project/fragmer/fnbt/branch/master )
22
33[ Named Binary Tag (NBT)] ( https://minecraft.gamepedia.com/NBT_format ) is a structured binary file format used by Minecraft.
4- fNbt is a small library, written in C# for .NET 3.5+ . It provides functionality
4+ fNbt is a small library, written in C#. It provides functionality
55to create, load, traverse, modify, and save NBT files and streams.
6+ The library provides a choice of convenient high-level APIs (NbtFile/NbtTag) that present an object model,
7+ or lower-level higher-performance APIs (NbtReader/NbtWriter) that read/write data directly to/from streams.
68
7- Current released version is 0.6.4 (6 July 2018 ).
9+ Current released version is 1.0.0 (15 April 2024 ).
810
911fNbt is based in part on Erik Davidson's (aphistic's) original LibNbt library,
1012now completely rewritten by Matvei Stefarov (fragmer).
@@ -27,19 +29,16 @@ applications that use fNbt; they are only used for testing.
2729
2830
2931## DOWNLOAD
30- Latest version of fNbt requires .NET Framework 3.5+ (client or full profile).
32+ Latest version of fNbt targets [ .NET Standard 2.0] ( https://learn.microsoft.com/en-us/dotnet/standard/net-standard?tabs=net-standard-2-0 ) ,
33+ which means it can be used in .NET Framework 4.6.1+, .NET Core 2.0+, Mono 5.4+, and more.
3134
3235- ** Package @ NuGet:** https://www.nuget.org/packages/fNbt/
3336
34- - ** Compiled binary:** https://fcraft.net/fnbt/fNbt_v0.6.4 .zip
37+ - ** Compiled binary:** https://fcraft.net/fnbt/fNbt_v1.0.0 .zip
3538 <br ><sup >SHA1: 600853530fd538e614b6cb4722ced81917e9615d</sup >
3639
37- - ** Amalgamation** (single source file):
38- * Non-annotated: https://fcraft.net/fnbt/fNbt_v0.6.4.cs
39- <br><sup>SHA1: 9298dbe00d080bcf5d32299415aaf856590ba3bf</sup>
40- * Annotated (using [JetBrains.Annotations](https://blog.jetbrains.com/dotnet/2018/05/03/what-are-jetbrains-annotations/)):
41- https://fcraft.net/fnbt/fNbt_v0.6.4_Annotated.cs
42- <br><sup>SHA1: ae096d83b57bf59c708ad66168d45c1ea9b58175</sup>
40+ - ** Amalgamation** (single source file): https://fcraft.net/fnbt/fNbt_v1.0.0.cs
41+ <br ><sup >SHA1: 9298dbe00d080bcf5d32299415aaf856590ba3bf</sup >
4342
4443
4544## EXAMPLES
@@ -92,6 +91,18 @@ Latest version of fNbt requires .NET Framework 3.5+ (client or full profile).
9291 serverFile .SaveToFile ( " server.nbt" , NbtCompression .None );
9392```
9493
94+ ### Writing to stream directly using NbtWriter
95+ ```
96+ using (var fileStream = File.Create("foo.nbt", bufferSize: 4 * 1024)) {
97+ var writer = new NbtWriter(fileStream, "Server");
98+ writer.WriteString("Name", "BestServerEver");
99+ writer.WriteInt("Players", 15);
100+ writer.WriteInt("MaxPlayers", 20);
101+ writer.EndCompound();
102+ writer.Finish();
103+ }
104+ ```
105+
95106#### Constructing using collection initializer notation
96107``` cs
97108 var compound = new NbtCompound (" root" ){
@@ -117,12 +128,11 @@ Latest version of fNbt requires .NET Framework 3.5+ (client or full profile).
117128
118129
119130## API REFERENCE
120- Online reference can be found at http://www.fcraft.net/fnbt/v0.6.4 /
131+ Online reference can be found at http://www.fcraft.net/fnbt/v1.0.0 /
121132
122133
123134## LICENSING
124- fNbt v0.5.0+ is licensed under 3-Clause BSD license;
125- see [ docs/LICENSE] ( docs/LICENSE ) .
135+ fNbt v0.5.0+ is licensed under 3-Clause BSD license; see [ docs/LICENSE] ( docs/LICENSE ) .
126136LibNbt2012 up to and including v0.4.1 kept LibNbt's original license (LGPLv3).
127137
128138
@@ -138,4 +148,4 @@ Note that this 0.5.x branch of fNbt is no longer supported or updated.
138148
139149- ** Amalgamation** (single source file):
140150 - Non-annotated: https://fcraft.net/fnbt/fNbt_v0.5.1.cs
141- - Annotated : https://fcraft.net/fnbt/fNbt_v0.5.1_Annotated.cs
151+ - With JetBrains annotations : https://fcraft.net/fnbt/fNbt_v0.5.1_Annotated.cs
0 commit comments