From 68f3ea56bdcf4664ee119016a0745d46f2c31a65 Mon Sep 17 00:00:00 2001 From: faketruth Date: Sat, 10 Mar 2012 02:39:36 +0000 Subject: You can change axis ordering by setting AXIS_ORDER to AXIS_ORDER_XZY in cChunk.h !THIS WILL SCREW UP YOUR WORLDS THOUGH! Still need to update world storage schemes, converters and such git-svn-id: http://mc-server.googlecode.com/svn/trunk@390 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/packets/cPacket_MapChunk.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'source/packets/cPacket_MapChunk.cpp') diff --git a/source/packets/cPacket_MapChunk.cpp b/source/packets/cPacket_MapChunk.cpp index 6fdd73f12..037b94396 100644 --- a/source/packets/cPacket_MapChunk.cpp +++ b/source/packets/cPacket_MapChunk.cpp @@ -38,6 +38,8 @@ cPacket_MapChunk::cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cha unsigned int DataSize = (cChunk::c_ChunkHeight / 16) * (4096 + 2048 + 2048 + 2048); std::auto_ptr AllData(new char[ DataSize ]); + +#if AXIS_ORDER == AXIS_ORDER_YZX memset( AllData.get(), 0, DataSize ); unsigned int iterator = 0; @@ -93,6 +95,13 @@ cPacket_MapChunk::cPacket_MapChunk(int a_ChunkX, int a_ChunkY, int a_ChunkZ, cha } } } +#else if AXIS_ORDER == AXIS_ORDER_XZY + for ( int i = 0; i < 16; ++i ) + { + m_BitMap1 |= (1 << i); + } + memcpy( AllData.get(), a_BlockData, DataSize ); +#endif uLongf CompressedSize = compressBound( DataSize ); char * CompressedBlockData = new char[CompressedSize]; @@ -159,6 +168,7 @@ cPacket_MapChunk::cPacket_MapChunk( const cPacket_MapChunk & a_Copy ) void cPacket_MapChunk::Serialize(AString & a_Data) const { + LOG("Sending chunk [%i, %i]", m_PosX, m_PosZ ); AppendByte (a_Data, m_PacketID); #if (MINECRAFT_1_2_2 == 1 ) -- cgit v1.2.3