Skip to content
forked from mstefarov/fNbt

A C# library for reading and writing Named Binary Tag (NBT) files and streams. A continuation of fNbt, originally by Matvei Stefarov (mstefarov).

License

Notifications You must be signed in to change notification settings

MelonSharp/NbtSharp

 
 

Repository files navigation

NbtSharp

A .NET Standard 2.0 NBT (de)serialization library written in C#, based on fNbt by Matvei Stefarov.

Build status Repo size License


Overview

Named Binary Tag (NBT) is a structured binary file format developed by Mojang and used throughout Minecraft.

NbtSharp is a .NET Standard 2.0 library providing functionality to create, load, traverse, modify, and save NBT files and streams. It is based on fNbt by Matvei Stefarov, which itself is based on LibNbt by Kristin Davidson (aphistic).

Why not .NET 5?

.NET Standard 2.0 offers support for many more environments (including .NET 5 environments), such as for use with the Unity 3D engine, which does not yet support .NET 5.

Features

  • Load and save uncompressed, GZip-, and ZLib-compressed files/streams.
  • Easily create, traverse, and modify NBT documents.
  • Simple indexer-based syntax for accessing compound, list, and nested tags.
  • Shortcut properties to access tags' values without unnecessary type casts.
  • Compound tags implement ICollection<T> and List tags implement IList<T>, for easy traversal and LINQ integration.
  • Good performance and low memory overhead.
  • Built-in pretty-printing of individual tags or whole files.
  • Every class and method are fully documented, annotated, and unit-tested.
  • Can work with both big-endian and little-endian NBT data and systems.
  • Optional high-performance reader/writer for working with streams directly.

Examples

Coming soon

Contributing

Contributions will be welcome in the near future. Please do not open a pull request at this time, it will be ignored. For issues with existing functionality, open an issue on the fNbt issue tracker.

License

NbtSharp is licensed under 3-Clause BSD; see LICENSE.md for more details.

fNbt is licensed under 3-Clause BSD; see its LICENSE for more details.

LibNbt is licensed under GNU GPL v3; see its LICENSE for more details.

About

A C# library for reading and writing Named Binary Tag (NBT) files and streams. A continuation of fNbt, originally by Matvei Stefarov (mstefarov).

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 100.0%