Convert Minecraft server world files into MCserver world files.
#50
I figured out quite a bit and am now successfully parsing the data.

I changed tag 7 to a char array and added tag 4 as a long. I can call data like the xPos like this:

Code:
printf("xPos: %i", NBTData->cNBTCompound::GetInteger("xPos") );
//will print
//xPos: 0


Trying to do anything with the arrays I made won't work though:
NBTData->cNBTCompound::GetByteArray("Blocks")[0]
calls a segmentation fault, but I can clearly see the ParseByteArray function loads the data into the array it passes to PutByteArray.

Code:
printf("VALUE: %s First 5 Chars: (%i,%i,%i,%i,%i)\n", Name.c_str(), ByteArray[0],ByteArray[1],ByteArray[2],ByteArray[3],ByteArray[4] );

prints the correct values

I'm stumped at this point. I'd imagine I can make this program work by using a publicly declared array and filling the arrays I want based on the data names, but I'd like to try and get NBTData->cNBTCompound::GetByteArray("Blocks") working if I can.

Any help and advice is always will be appreciated. Big Grin

printing of the data looks like this. It is missing the new tag I put in. I'm not sure why, but I haven't really look yet.
Code:
Tag End==== STRUCTURED NBT DATA ====
COMPOUND ( )
     COMPOUND
         COMPOUND (Level)
            LIST (Entities)
            LIST (TileEntities)
            INTEGER LastUpdate (0)
            INTEGER xPos (0)
            INTEGER zPos (0)
            BYTE TerrainPopulated (1)
=============================

Newest changes are here:
http://code.google.com/p/mc-server/source/detail?r=26
Reply
Thanks given by:


Messages In This Thread
RE: Convert Minecraft server world files into MCserver world files. - by rs2k - 10-30-2011, 07:04 PM



Users browsing this thread: 1 Guest(s)