1
0

Leaves: Applied patch by Luksor.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@624 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
cedeel@gmail.com 2012-06-16 18:12:43 +00:00
parent 1afe0d2534
commit 861fa61dfc
2 changed files with 25 additions and 1 deletions

View File

@ -591,8 +591,27 @@ void cChunk::TickBlocks(MTRand & a_TickRandom)
break;
}
case E_BLOCK_LEAVES: //todo, http://www.minecraftwiki.net/wiki/Data_values#Leaves
case E_BLOCK_LEAVES:
{
NIBBLETYPE Meta = GetMeta(m_BlockTickX, m_BlockTickY, m_BlockTickZ);
if (((Meta & 0x04) == 0) && ((Meta & 0x08) == 1)){
int x,y,z,f = 0;
for( y = 4; y > - 5; y-- ) {
for( x = - 4; x < 5; x++ ){
for( z = - 4; z < 5; z++ ){
if((x<0 ? -x : x) + (y<0 ? -y : y) + (z<0 ? -z : z) > 4) continue;
if(GetBlock(m_BlockTickX + x, m_BlockTickY + y, m_BlockTickZ + z) == E_BLOCK_LOG){
f = 1;
}
}
}
}
if(f==0){
SetBlock(m_BlockTickX, m_BlockTickY, m_BlockTickZ, 0, 0);
}else{
SetMeta(m_BlockTickX, m_BlockTickY, m_BlockTickZ, Meta -= 8);
}
}
break;
}

View File

@ -1270,6 +1270,11 @@ void cClientHandle::HandleBlockPlace(cPacket_BlockPlace * a_Packet)
bRemoveItem = false;
break;
}
case E_BLOCK_LEAVES:
{
MetaData += 0x4;
break;
}
case E_ITEM_SEEDS:
{
if (ClickedBlock != E_BLOCK_FARMLAND)