A named binary tag library (file format used in the computer game Minecraft) for .net written in C#.
Features:
Classes representing each type of tag
NBT data file reader and writer classes
Built-in handling of endianess
Get tags from paths
//reading bigtest
NBTFileReader reader = new NBTFileReader(@"C:\bigtest.nbt");
TagCompound root = reader.compound;
TagLong longTest = (TagLong)root.getNode(@"Level\longTest");
Console.WriteLine(longTest);
9223372036854775807
//map item files can be found in Minecraft\world\data
NBTFileReader reader = new NBTFileReader(@"C:\map_0.dat");
TagCompound root = reader.compound;
//the path starts with a back slash
//because the root node in a map item has no name
TagByte dimension = (TagByte)root.getNode(@"\data\dimension");
Console.WriteLine(dimension);
This will output the dimension the map is from, i.e. World, or Nether
//changing the scale in a map item file allows for different zoom levels
//reading the map item
sbyte scale = 1; //change the number here to any number above 0
NBTFileReader reader = new NBTFileReader(@"C:\map_0.dat");
TagCompound root = reader.compound;
//finding the scale tag
TagByte tagScale = (TagByte)root.getNode(@"\data\scale");
//changing the value
tagScale.number = scale;
//the file is automatically closed after the read is complete
//so we can use the nbtfilewriter to write out the compound
NBTFileWriter.write(@"C:\map_0.dat", root);
The file can now be used in Minecraft, and it will have a different scale
//checking that the change was successfully made
//reading the map item
sbyte scale = 1;
NBTFileReader reader = new NBTFileReader(@"C:\map_0.dat");
TagCompound root = reader.compound;
//finding the scale tag
TagByte tagScale = (TagByte)root.getNode(@"\data\scale");
Console.WriteLine(tagScale);
1