fNbt
fNbt copied to clipboard
Minecraft: Windows 10 Edition Compatibility issue
trafficstars
I just tried using fNbt to load the level.dat file for a Minecraft Windows 10 Edition save and was met with two exceptions.
The first was that it was unable to detect the compression format:
System.IO.InvalidDataException: Could not auto-detect compression format.
at fNbt.NbtFile.DetectCompression(Stream stream)
I tried to remedy that by explicitly calling nbtFile.LoadFromFile(levelDatFile, NbtCompression.None, null). This worked, but the next error I encountered was:
fNbt.NbtFormatException: Given NBT stream does not start with a TAG_Compound
at fNbt.NbtFile.LoadFromStreamInternal(Stream stream, TagSelector tagSelector)
So, whatever Mojang did for the Windows 10 Edition of Minecraft seems to have introduced some compatibility issues with fNbt.
Try this:
var file = new NbtFile();
file.BigEndian = false;
byte[] data = File.ReadAllBytes(levelDatFile);
file.LoadFromBuffer(data, 8, data.Length - 8, NbtCompression.None);
Try this:
var file = new NbtFile(); file.BigEndian = false; byte[] data = File.ReadAllBytes(levelDatFile); file.LoadFromBuffer(data, 8, data.Length - 8, NbtCompression.None);
How do i save the file then?