Actually it seems to screw up after the Biome data
Gives this:
a_Writer.BeginCompound("Level"); a_Writer.AddInt("xPos", a_Chunk.m_ChunkX); a_Writer.AddInt("zPos", a_Chunk.m_ChunkZ); cNBTChunkSerializer Serializer(a_Writer); if (!m_World->GetChunkData(a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ, Serializer)) { return false; } Serializer.Finish(); // Close NBT tags a_Writer.AddString("TestString1", "o hai I'm string"); a_Writer.AddDouble("TestDouble1", 1.23); a_Writer.AddFloat("TestFloat1", 1.23f); a_Writer.AddInt("TestInt1", 2); a_Writer.AddLong("TestLong1", 1234); a_Writer.AddShort("TestShort1", 1234); a_Writer.AddByte("TestByte1", 34); // Save biomes, both MCS (IntArray) and MC-vanilla (ByteArray): if (Serializer.m_BiomesAreValid) { a_Writer.AddByteArray("Biomes", (const char *)(Serializer.m_VanillaBiomes), ARRAYCOUNT(Serializer.m_VanillaBiomes)); a_Writer.AddIntArray ("MCSBiomes", (const int *)(Serializer.m_Biomes), ARRAYCOUNT(Serializer.m_Biomes)); } a_Writer.AddString("TestString2", "o hai I'm string"); a_Writer.AddDouble("TestDouble2", 1.23); a_Writer.AddFloat("TestFloat2", 1.23f); a_Writer.AddInt("TestInt2", 2); a_Writer.AddLong("TestLong2", 1234); a_Writer.AddShort("TestShort2", 1234); a_Writer.AddByte("TestByte2", 34); a_Writer.AddIntArray("TestIntArray", (const int *)Serializer.m_Biomes, 2); // Save blockdata: a_Writer.BeginList("Sections", TAG_Compound); int SliceSizeBlock = cChunkDef::Width * cChunkDef::Width * 16; int SliceSizeNibble = SliceSizeBlock / 2; const char * BlockTypes = (const char *)(Serializer.m_BlockTypes); const char * BlockMetas = (const char *)(Serializer.m_BlockMetas); const char * BlockLight = (const char *)(Serializer.m_BlockLight); const char * BlockSkyLight = (const char *)(Serializer.m_BlockSkyLight); a_Writer.AddIntArray("TestIntArray2", (const int *)Serializer.m_Biomes, 2); for (int Y = 0; Y < 16; Y++) { a_Writer.BeginCompound(""); a_Writer.AddByteArray("Blocks", BlockTypes + Y * SliceSizeBlock, SliceSizeBlock); a_Writer.AddByteArray("Data", BlockMetas + Y * SliceSizeNibble, SliceSizeNibble); a_Writer.AddByteArray("SkyLight", BlockSkyLight + Y * SliceSizeNibble, SliceSizeNibble); a_Writer.AddByteArray("BlockLight", BlockLight + Y * SliceSizeNibble, SliceSizeNibble); a_Writer.AddByte("Y", (unsigned char)Y); a_Writer.EndCompound(); } a_Writer.EndList(); // "Sections" a_Writer.AddIntArray("TestIntArray3", (const int *)Serializer.m_Biomes, 2); a_Writer.AddString("TestString3", "o hai I'm string"); a_Writer.AddDouble("TestDouble3", 1.23); a_Writer.AddFloat("TestFloat3", 1.23f); a_Writer.AddInt("TestInt3", 2); a_Writer.AddLong("TestLong3", 1234); a_Writer.AddShort("TestShort3", 1234); a_Writer.AddByte("TestByte3", 34); // Store the information that the lighting is valid. // For compatibility reason, the default is "invalid" (missing) - this means older data is re-lighted upon loading. if (Serializer.IsLightValid()) { a_Writer.AddByte("MCSIsLightValid", 1); } a_Writer.EndCompound(); // "Level"
Gives this: