summaryrefslogtreecommitdiffstats
path: root/src/Blocks/ChunkInterface.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Blocks/ChunkInterface.cpp')
-rw-r--r--src/Blocks/ChunkInterface.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/Blocks/ChunkInterface.cpp b/src/Blocks/ChunkInterface.cpp
index fd64ee9fc..15198dd37 100644
--- a/src/Blocks/ChunkInterface.cpp
+++ b/src/Blocks/ChunkInterface.cpp
@@ -12,6 +12,15 @@
+bool cChunkInterface::DoWithChunkAt(Vector3i a_BlockPos, cChunkCallback a_Callback)
+{
+ return m_ChunkMap->DoWithChunkAt(a_BlockPos, a_Callback);
+}
+
+
+
+
+
BLOCKTYPE cChunkInterface::GetBlock(Vector3i a_Pos)
{
return m_ChunkMap->GetBlock(a_Pos);
@@ -95,16 +104,16 @@ bool cChunkInterface::WriteBlockArea(cBlockArea & a_Area, int a_MinBlockX, int a
bool cChunkInterface::DigBlock(cWorldInterface & a_WorldInterface, Vector3i a_BlockPos)
{
- BLOCKTYPE blockType;
- NIBBLETYPE blockMeta;
- GetBlockTypeMeta(a_BlockPos, blockType, blockMeta);
- auto handler = cBlockInfo::GetHandler(blockType);
- handler->OnBreaking(*this, a_WorldInterface, a_BlockPos);
+ BLOCKTYPE BlockType;
+ NIBBLETYPE BlockMeta;
+ GetBlockTypeMeta(a_BlockPos, BlockType, BlockMeta);
+
if (!m_ChunkMap->DigBlock(a_BlockPos))
{
return false;
}
- handler->OnBroken(*this, a_WorldInterface, a_BlockPos, blockType, blockMeta);
+
+ cBlockInfo::GetHandler(BlockType)->OnBroken(*this, a_WorldInterface, a_BlockPos, BlockType, BlockMeta);
return true;
}