1
0

Moved blockticking into blockhandler classes.

Also slightly refactored the variable / argument names (BlockID is deprecated, use BlockType instead)

git-svn-id: http://mc-server.googlecode.com/svn/trunk@921 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2012-10-03 08:52:11 +00:00
parent 9fa165488b
commit ea2ed2c918
75 changed files with 681 additions and 547 deletions

View File

@@ -482,22 +482,7 @@ void cChunk::TickBlocks(MTRand & a_TickRandom)
BLOCKTYPE ID = m_BlockTypes[Index];
switch( ID )
{
case E_BLOCK_CROPS:
{
NIBBLETYPE Meta = GetMeta(Index);
if (Meta < 7)
{
FastSetBlock(m_BlockTickX, m_BlockTickY, m_BlockTickZ, E_BLOCK_CROPS, ++Meta);
}
break;
}
case E_BLOCK_PUMPKIN_STEM:
case E_BLOCK_MELON_STEM: TickMelonPumpkin(m_BlockTickX, m_BlockTickY, m_BlockTickZ, Index, ID, a_TickRandom); break;
case E_BLOCK_FARMLAND: TickFarmland (m_BlockTickX, m_BlockTickY, m_BlockTickZ); break;
case E_BLOCK_SUGARCANE: GrowSugarcane (m_BlockTickX, m_BlockTickY, m_BlockTickZ, 1); break;
case E_BLOCK_CACTUS: GrowCactus (m_BlockTickX, m_BlockTickY, m_BlockTickZ, 1); break;
case E_BLOCK_FARMLAND: TickFarmland (m_BlockTickX, m_BlockTickY, m_BlockTickZ); break;
default:
{
@@ -514,21 +499,6 @@ void cChunk::TickBlocks(MTRand & a_TickRandom)
void cChunk::TickMelonPumpkin(int a_RelX, int a_RelY, int a_RelZ, int a_BlockIdx, BLOCKTYPE a_BlockType, MTRand & a_TickRandom)
{
NIBBLETYPE Meta = GetMeta(a_BlockIdx);
if (Meta < 7)
{
FastSetBlock(m_BlockTickX, m_BlockTickY, m_BlockTickZ, a_BlockType, ++Meta);
return;
}
GrowMelonPumpkin(a_RelX, a_RelY, a_RelZ, a_BlockType, a_TickRandom);
}
void cChunk::TickFarmland(int a_RelX, int a_RelY, int a_RelZ)
{
// TODO: Rain hydrates blocks, too. Check world weather, don't search for water if raining.