fNbt icon indicating copy to clipboard operation
fNbt copied to clipboard

Minecraft: Windows 10 Edition Compatibility issue

Open JERisBRISK opened this issue 6 years ago • 2 comments
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.

JERisBRISK avatar Aug 25 '19 01:08 JERisBRISK

Try this:

 var file = new NbtFile();
 file.BigEndian = false;
 byte[] data = File.ReadAllBytes(levelDatFile);
 file.LoadFromBuffer(data, 8, data.Length - 8, NbtCompression.None);

tryashtar avatar Jul 06 '20 20:07 tryashtar

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?

brammie15 avatar Jul 12 '24 11:07 brammie15