Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I've been trying to write some Java code to read .mca files, based on the information at http://wiki.vg/Map_Format and http://wiki.vg/User:Sprenger120 . I am at the point where I can read in the header correctly, and read the header for each section, telling me its compression mode and size. I am now trying to inflate the NBT blob that is the actual section, but it's not working at all. I just get "java.io.IOException: Not in GZIP format".

I'm starting the deflation stream five bytes into the memory segment specified by the header, and given that I am consistently getting sane section sizes and compression types, it seems like I'm managing to parse correctly up to this point, but now I'm stuck.

The code is at: https://github.com/Zarkonnen/Ager/tree/master/src/ager

I don't know if this is the correct forum to ask this kind of question - if it isn't, I apologise and would be very thankful if someone could direct me to a good place to ask it.

share|improve this question
    
Your github link is a 404. You pasted a URL that actually has ... in it. –  doppelgreener Apr 28 '12 at 22:30
    
Gah! @Harry Stern: Thanks for fixing that! –  Zarkonnen Apr 29 '12 at 7:06
    
So the 5th byte of the data header is a 1 for the file you are parsing? –  Joshua Drake Apr 30 '12 at 15:16

1 Answer 1

up vote 0 down vote accepted

OK, so the immediate answer to this turns out to be that JNBT internally tries to decompress the stream using GZIP, so I was decompressing it twice.

In the end, the better way of going about it was to use the code supplied by Mojang at http://www.mojang.com/2012/02/new-minecraft-map-format-anvil/ .

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.