Convert Minecraft server world files into MCserver world files.
#36
(10-30-2011, 09:47 AM)FakeTruth Wrote: So I'm looking at your code, and I'm trying to understand what the hell is going on in the first couple of lines you're actually reading the file and I didn't get it. So I look up the mcr file definition on the wiki, and I see this table and I finally understand what's going on
[Image: 30119420283-orig.png]
But seriously... WHAT THE FUCK. Why the hell does he want to cripple the shit out of an integer (4 bytes) to save a single byte per chunk.. I mean.. come on..

I'm pretty sure Notch is a huge fan of Ruth Goldberg.

The 4th byte isn't even needed. It's an estimate of how large the chunk is which doesn't even matter. There's a lot of junk and empty data in an MCR.

You have to go to the chunk's offset which is a calculation of (the big-endian value of the first three bytes * 4096). Then the first few bytes there give you the actual size of the chunk as well as the compress method employed. Right after that there's either junk data, empty data, or a mix of the two until you get to the next chunk's offset.

After decompression the data collected. The compressed chunks are stored in the exact same method he used in alpha, the nbt format.

It's a huge mess. Your way makes so much more sense. The program I created loads the uncompressed block data into the char array BlockData of DestSize size. That data needs to be parsed to pull out the NBT information. I'm in the process of working on my own parser, but if yours will work then that will save some time. Big Grin

I can understand and parse NBT data by hand (what a PITA), now I just need to turn that into C++ code.

At some point I'm going to have to go through and figure out all the possible entities his NBT data can store so I can convert them to your JSON format, right now the neither program I made does that. It just transfers block data, meta data, skylight, and block light.

I'm happy to explain any part of the program and why I did what I did. Some of what I did is because of my lack of C++ knowledge, some is because I couldn't think of other ways to do it. I usually go back and rewrite a working program to be "better" after I actually get it doing what I want. You're looking at a half finished mess of mine. lol. It's a work in progress, a very rough draft. I try things inside the code I'm working with, write down notes, whatever. That gets removed when the program gets finished. Though I usually save some of that old data for future reference on my own PC.
Reply
Thanks given by:


Messages In This Thread
RE: Convert Minecraft server world files into MCserver world files. - by rs2k - 10-30-2011, 09:53 AM



Users browsing this thread: 1 Guest(s)