Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minecraft: Windows 10 Edition Compatibility issue #31

Open
JERisBRISK opened this issue Aug 25, 2019 · 2 comments
Open

Minecraft: Windows 10 Edition Compatibility issue #31

JERisBRISK opened this issue Aug 25, 2019 · 2 comments

Comments

@JERisBRISK
Copy link

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.

@tryashtar
Copy link

Try this:

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

@brammie15
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants