From 4004129e112779e853813432434f2a04e8973776 Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sat, 10 Mar 2012 21:42:18 +0000 Subject: Anvil support: compatible with both chunk orderings git-svn-id: http://mc-server.googlecode.com/svn/trunk@395 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/WSSAnvil.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/source/WSSAnvil.cpp b/source/WSSAnvil.cpp index ce9afc652..d3b4a51fe 100644 --- a/source/WSSAnvil.cpp +++ b/source/WSSAnvil.cpp @@ -225,6 +225,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, cNBTTag & a_NBT) LoadEntitiesFromNBT (Entities, (cNBTList *)(a_NBT.FindChildByPath("Level\\Entities"))); LoadBlockEntitiesFromNBT(BlockEntities, (cNBTList *)(a_NBT.FindChildByPath("Level\\TileEntities"))); + #if (AXIS_ORDER == AXIS_ORDER_YZX) // Reorder the chunk data - walk the MCA-formatted data sequentially and copy it into the right place in the ChunkData: char ChunkData[cChunk::c_BlockDataSize]; memset(ChunkData, 0, sizeof(ChunkData)); @@ -255,6 +256,9 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, cNBTTag & a_NBT) cChunk::SetNibble(ChunkSkyLight, x, y, z, SkyLight[Index / 2] >> ((Index % 2) * 4)); Index++; } // for y/z/x + #else // AXIS_ORDER_YZX + char * ChunkData = BlockData; + #endif // else AXIS_ORDER_YZX m_World->ChunkDataLoaded(a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ, ChunkData, Entities, BlockEntities); return true; -- cgit v1.2.3