Anvil support: compatible with both chunk orderings
git-svn-id: http://mc-server.googlecode.com/svn/trunk@395 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
parent
e7731242c1
commit
4004129e11
@ -225,6 +225,7 @@ bool cWSSAnvil::LoadChunkFromNBT(const cChunkCoords & a_Chunk, cNBTTag & a_NBT)
|
|||||||
LoadEntitiesFromNBT (Entities, (cNBTList *)(a_NBT.FindChildByPath("Level\\Entities")));
|
LoadEntitiesFromNBT (Entities, (cNBTList *)(a_NBT.FindChildByPath("Level\\Entities")));
|
||||||
LoadBlockEntitiesFromNBT(BlockEntities, (cNBTList *)(a_NBT.FindChildByPath("Level\\TileEntities")));
|
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:
|
// 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];
|
char ChunkData[cChunk::c_BlockDataSize];
|
||||||
memset(ChunkData, 0, sizeof(ChunkData));
|
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));
|
cChunk::SetNibble(ChunkSkyLight, x, y, z, SkyLight[Index / 2] >> ((Index % 2) * 4));
|
||||||
Index++;
|
Index++;
|
||||||
} // for y/z/x
|
} // 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);
|
m_World->ChunkDataLoaded(a_Chunk.m_ChunkX, a_Chunk.m_ChunkY, a_Chunk.m_ChunkZ, ChunkData, Entities, BlockEntities);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user