summaryrefslogtreecommitdiffstats
path: root/src/Blocks/BlockHandler.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2015-07-01 10:40:16 +0200
committerMattes D <github@xoft.cz>2015-07-01 10:40:16 +0200
commit66a164a9a75a2d48763520aab3aeb8eeda85c92d (patch)
tree6b16a888c3abce218cd76a719312811a63f0e5f6 /src/Blocks/BlockHandler.cpp
parentAPIDump: Fixed a forgotten comma. (diff)
downloadcuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.gz
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.bz2
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.lz
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.xz
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.tar.zst
cuberite-66a164a9a75a2d48763520aab3aeb8eeda85c92d.zip
Diffstat (limited to '')
-rw-r--r--src/Blocks/BlockHandler.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/Blocks/BlockHandler.cpp b/src/Blocks/BlockHandler.cpp
index 520d0d328..412fc3aeb 100644
--- a/src/Blocks/BlockHandler.cpp
+++ b/src/Blocks/BlockHandler.cpp
@@ -389,12 +389,12 @@ void cBlockHandler::OnDestroyedByPlayer(cChunkInterface & a_ChunkInterface, cWor
void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
// Notify the neighbors
- NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1);
+ NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ, BLOCK_FACE_XP);
+ NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ, BLOCK_FACE_XM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ, BLOCK_FACE_YP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_YM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1, BLOCK_FACE_ZP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1, BLOCK_FACE_ZM);
}
@@ -404,23 +404,23 @@ void cBlockHandler::OnPlaced(cChunkInterface & a_ChunkInterface, cWorldInterface
void cBlockHandler::OnDestroyed(cChunkInterface & a_ChunkInterface, cWorldInterface & a_WorldInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
{
// Notify the neighbors
- NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1);
- NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1);
+ NeighborChanged(a_ChunkInterface, a_BlockX - 1, a_BlockY, a_BlockZ, BLOCK_FACE_XP);
+ NeighborChanged(a_ChunkInterface, a_BlockX + 1, a_BlockY, a_BlockZ, BLOCK_FACE_XM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY - 1, a_BlockZ, BLOCK_FACE_YP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY + 1, a_BlockZ, BLOCK_FACE_YM);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ - 1, BLOCK_FACE_ZP);
+ NeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ + 1, BLOCK_FACE_ZM);
}
-void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, int a_BlockX, int a_BlockY, int a_BlockZ)
+void cBlockHandler::NeighborChanged(cChunkInterface & a_ChunkInterface, int a_NeighborX, int a_NeighborY, int a_NeighborZ, eBlockFace a_WhichNeighbor)
{
- if ((a_BlockY >= 0) && (a_BlockY < cChunkDef::Height))
+ if ((a_NeighborY >= 0) && (a_NeighborY < cChunkDef::Height))
{
- cBlockInfo::GetHandler(a_ChunkInterface.GetBlock(a_BlockX, a_BlockY, a_BlockZ))->OnNeighborChanged(a_ChunkInterface, a_BlockX, a_BlockY, a_BlockZ);
+ cBlockInfo::GetHandler(a_ChunkInterface.GetBlock(a_NeighborX, a_NeighborY, a_NeighborZ))->OnNeighborChanged(a_ChunkInterface, a_NeighborX, a_NeighborY, a_NeighborZ, a_WhichNeighbor);
}
}