1
0
cuberite-2a/source/cLuaChunk.h
faketruth 373dac3204 Added implementation of E_PLUGIN_CHUNK_GENERATING lua hook
It crashes the server when a plugin actually overrides default behavior though...

git-svn-id: http://mc-server.googlecode.com/svn/trunk@594 0a769ca7-a7f5-676a-18bf-c427514a06d6
2012-06-11 19:25:55 +00:00

39 lines
1.2 KiB
C++

#pragma once
#include "ChunkDef.h"
class cLuaChunk //tolua_export
{ //tolua_export
public:
cLuaChunk( cChunkDef::BlockTypes & a_BlockTypes
, cChunkDef::BlockNibbles & a_BlockNibbles
, cChunkDef::HeightMap & a_HeightMap
, cChunkDef::BiomeMap & a_BiomeMap
)
: m_BiomeMap( a_BiomeMap )
, m_BlockTypes( a_BlockTypes )
, m_BlockMeta( a_BlockNibbles )
, m_HeightMap( a_HeightMap )
{}
~cLuaChunk()
{}
void SetBlock( const Vector3i & a_Pos, char a_BlockID, unsigned char a_BlockMeta ) //tolua_export
{ //tolua_export
} //tolua_export
void FillBlocks( char a_BlockID, unsigned char a_BlockMeta ) //tolua_export
{ //tolua_export
const NIBBLETYPE CompressedMeta = a_BlockMeta | a_BlockMeta << 4;
memset( m_BlockTypes, a_BlockID, sizeof( cChunkDef::BlockTypes ) );
memset( m_BlockMeta, CompressedMeta, sizeof( cChunkDef::BlockNibbles ) );
memset( m_BiomeMap, 0, sizeof( cChunkDef::BiomeMap ) );
memset( m_HeightMap, 0, sizeof( cChunkDef::HeightMap ) );
} //tolua_export
private:
EMCSBiome * m_BiomeMap;
BLOCKTYPE * m_BlockTypes;
NIBBLETYPE * m_BlockMeta;
HEIGHTTYPE * m_HeightMap;
}; //tolua_export