Skip to content

Convert stringified NBT files (.snbt) to NBT files (.nbt) - Useful for converting and compressing Minecraft NBT

License

Notifications You must be signed in to change notification settings

jonesdevelopment/snbt2nbt

Repository files navigation

snbt to nbt

Simple library for converting and compressing stringified nbt (.snbt) files into .nbt files.
Used by Sonar for processing compressed NBT mappings for Minecraft packets



Issues | Pull Requests | Discord | License

How to use

  1. Add the dependency to your project
  2. Prepare your .snbt file you would like to read/convert.

Example code

Convert SNBT to NBT

final Path snbt = new File("test.snbt").toPath();
final CompoundBinaryTag converted = SNBTConverter.from(snbt);

Save the converted SNBT to a NBT file

final Path snbt = new File("test.snbt").toPath();
final Path nbt = new File("test-output.nbt").toPath();
// snbt2nbt(Path,Path) uses GZIP compression by default
SNBTConverter.snbt2nbt(snbt, nbt);

Use a compressor (GZIP, ZLIB, NONE)

// ...
SNBTConverter.snbt2nbt(snbt, nbt, NBTCompressor.GZIP);

Read more about NBT

License

snbt2nbt is licensed under the GNU General Public License 3.0.

About

Convert stringified NBT files (.snbt) to NBT files (.nbt) - Useful for converting and compressing Minecraft NBT

Topics

Resources

License

Stars

Watchers

Forks

Languages