1
0

Rename CanChangeDirtToGrass to CanDirtGrowGrass

This commit is contained in:
Howaner 2014-05-07 12:59:48 +02:00
parent f5fe368220
commit 36a2aa2f21
6 changed files with 9 additions and 9 deletions

View File

@ -39,7 +39,7 @@ public:
}
virtual bool CanChangeDirtToGrass(BLOCKTYPE a_Block, NIBBLETYPE a_Meta) override
virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
{
return true;
}

View File

@ -38,7 +38,7 @@ public:
BLOCKTYPE Above;
NIBBLETYPE AboveMeta;
a_Chunk.GetBlockTypeMeta(a_RelX, a_RelY + 1, a_RelZ, Above, AboveMeta);
if ((IsBlockWater(Above)) || !cBlockInfo::GetHandler(Above)->CanChangeDirtToGrass(Above, AboveMeta))
if ((IsBlockWater(Above)) || !cBlockInfo::GetHandler(Above)->CanDirtGrowGrass(AboveMeta))
{
a_Chunk.FastSetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_DIRT, E_META_DIRT_NORMAL);
return;
@ -79,7 +79,7 @@ public:
BLOCKTYPE AboveDest;
NIBBLETYPE AboveMeta;
Chunk->GetBlockTypeMeta(BlockX, BlockY + 1, BlockZ, AboveDest, AboveMeta);
if ((!IsBlockWater(AboveDest)) && (cBlockInfo::GetHandler(AboveDest)->CanChangeDirtToGrass(AboveDest, AboveMeta)))
if ((!IsBlockWater(AboveDest)) && (cBlockInfo::GetHandler(AboveDest)->CanDirtGrowGrass(AboveMeta)))
{
if (!cRoot::Get()->GetPluginManager()->CallHookBlockSpread((cWorld*) &a_WorldInterface, BlockX * cChunkDef::Width, BlockY, BlockZ * cChunkDef::Width, ssGrassSpread))
{

View File

@ -400,9 +400,9 @@ bool cBlockHandler::CanBeAt(cChunkInterface & a_ChunkInterface, int a_BlockX, in
bool cBlockHandler::CanChangeDirtToGrass(BLOCKTYPE a_Block, NIBBLETYPE a_Meta)
bool cBlockHandler::CanDirtGrowGrass(NIBBLETYPE a_Meta)
{
return ((cBlockInfo::IsTransparent(a_Block)) || (cBlockInfo::IsOneHitDig(a_Block)));
return ((cBlockInfo::IsTransparent(m_BlockType)) || (cBlockInfo::IsOneHitDig(m_BlockType)));
}

View File

@ -86,8 +86,8 @@ public:
/// Checks if the block can stay at the specified relative coords in the chunk
virtual bool CanBeAt(cChunkInterface & a_ChunkInterface, int a_RelX, int a_RelY, int a_RelZ, const cChunk & a_Chunk);
/** Can change the block under this block to grass? */
virtual bool CanChangeDirtToGrass(BLOCKTYPE a_Block, NIBBLETYPE a_Meta);
/** Can the dirt under this block grow to grass? */
virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta);
/** Checks if the block can be placed at this point.
Default: CanBeAt(...)

View File

@ -98,7 +98,7 @@ public:
}
virtual bool CanChangeDirtToGrass(BLOCKTYPE a_Block, NIBBLETYPE a_Meta) override
virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
{
return (a_Meta & 0x8);
}

View File

@ -78,7 +78,7 @@ public:
a_Pickups.push_back(cItem(m_BlockType, 1, 0));
}
virtual bool CanChangeDirtToGrass(BLOCKTYPE a_Block, NIBBLETYPE a_Meta) override
virtual bool CanDirtGrowGrass(NIBBLETYPE a_Meta) override
{
return true;
}