nbt_codec 0.0.2
nbt_codec: ^0.0.2 copied to clipboard
NBT Codec is a Minecraft NBT tag reader and writer that works in both browser and server.
Dart NBT Codec #
This library for Dart allows you to read and write NBT structures, you can also supply the compression type to deflate the nbt data.
The libraries provides an example inside the example directory. The tests files also contains an example for loading nbt data via the browser.
Example Usage #
First import the nbt codec (and io if you are using serverside file loading):
import "package:nbt_codec/nbt_codec.dart";
Then in your main load in an NBT file
void main () {
File f = new File("level.dat");
CompoundTag tag = readNBT(f.readAsBytesSync(), compressionType: CompressionType.G_ZIP);
print(tag);
}
This will output a json serialized representation of your level.dat nbt data.
Read the documentation to find out how to further manipulate the NBT Data
TODO #
- Better examples
- Better hashCode handling
- Check that Int64 is handled correctly on dart2js
- Implement the Java modified version of readUTF for UTF8 Strings
