1
0

cChunkInterface GetBlock, GetBlockMeta, GetBlockTypeMeta use vectors (#4050)

This commit is contained in:
Bond-009
2017-11-20 12:13:11 +01:00
committed by Alexander Harkness
parent bf5e6874fe
commit 5badb9bcca
37 changed files with 179 additions and 190 deletions

View File

@@ -10,28 +10,18 @@
BLOCKTYPE cChunkInterface::GetBlock(int a_BlockX, int a_BlockY, int a_BlockZ)
BLOCKTYPE cChunkInterface::GetBlock(Vector3i a_Pos)
{
return m_ChunkMap->GetBlock(a_BlockX, a_BlockY, a_BlockZ);
return m_ChunkMap->GetBlock(a_Pos.x, a_Pos.y, a_Pos.z);
}
BLOCKTYPE cChunkInterface::GetBlock(const Vector3i & a_Pos)
NIBBLETYPE cChunkInterface::GetBlockMeta(Vector3i a_Pos)
{
return GetBlock(a_Pos.x, a_Pos.y, a_Pos.z);
}
NIBBLETYPE cChunkInterface::GetBlockMeta(int a_BlockX, int a_BlockY, int a_BlockZ)
{
return m_ChunkMap->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ);
return m_ChunkMap->GetBlockMeta(a_Pos.x, a_Pos.y, a_Pos.z);
}
@@ -39,9 +29,9 @@ NIBBLETYPE cChunkInterface::GetBlockMeta(int a_BlockX, int a_BlockY, int a_Block
bool cChunkInterface::GetBlockTypeMeta(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta)
bool cChunkInterface::GetBlockTypeMeta(Vector3i a_Pos, BLOCKTYPE & a_BlockType, NIBBLETYPE & a_BlockMeta)
{
return m_ChunkMap->GetBlockTypeMeta(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
return m_ChunkMap->GetBlockTypeMeta(a_Pos.x, a_Pos.y, a_Pos.z, a_BlockType, a_BlockMeta);
}
@@ -125,7 +115,7 @@ bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a
bool cChunkInterface::DigBlock(cWorldInterface & a_WorldInterface, int a_X, int a_Y, int a_Z)
{
cBlockHandler * Handler = cBlockInfo::GetHandler(GetBlock(a_X, a_Y, a_Z));
cBlockHandler * Handler = cBlockInfo::GetHandler(GetBlock({a_X, a_Y, a_Z}));
Handler->OnDestroyed(*this, a_WorldInterface, a_X, a_Y, a_Z);
return m_ChunkMap->DigBlock(a_X, a_Y, a_Z);
}