1
0

Refactored all player block placing to go through hooks.

Fixes #1618.
This commit is contained in:
Mattes D
2014-12-24 07:20:17 +01:00
parent 075b19c7cb
commit ccdf03daaf
43 changed files with 1421 additions and 773 deletions

View File

@@ -1463,7 +1463,7 @@ void cWorld::GrowTreeImage(const sSetBlockVector & a_Blocks)
sSetBlockVector b2;
for (sSetBlockVector::const_iterator itr = a_Blocks.begin(); itr != a_Blocks.end(); ++itr)
{
if (itr->BlockType == E_BLOCK_LOG)
if (itr->m_BlockType == E_BLOCK_LOG)
{
b2.push_back(*itr);
}
@@ -1478,7 +1478,7 @@ void cWorld::GrowTreeImage(const sSetBlockVector & a_Blocks)
// Check that at each log's coord there's an block allowed to be overwritten:
for (sSetBlockVector::const_iterator itr = b2.begin(); itr != b2.end(); ++itr)
{
switch (itr->BlockType)
switch (itr->m_BlockType)
{
CASE_TREE_ALLOWED_BLOCKS:
{
@@ -1926,6 +1926,15 @@ void cWorld::SpawnPrimedTNT(double a_X, double a_Y, double a_Z, int a_FuseTicks,
void cWorld::SetBlocks(const sSetBlockVector & a_Blocks)
{
m_ChunkMap->SetBlocks(a_Blocks);
}
void cWorld::ReplaceBlocks(const sSetBlockVector & a_Blocks, BLOCKTYPE a_FilterBlockType)
{
m_ChunkMap->ReplaceBlocks(a_Blocks, a_FilterBlockType);