diff options
author | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-15 21:18:11 +0100 |
---|---|---|
committer | madmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2013-03-15 21:18:11 +0100 |
commit | 8090c13cde2d61a0330f1e262de7526318a0965d (patch) | |
tree | 8a5f53d6113c25ee49caacea5c52548dc1585f91 /source/Blocks/BlockHandler.cpp | |
parent | Doxygen: Alpha-sorted class member docs (diff) | |
download | cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.gz cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.bz2 cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.lz cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.xz cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.tar.zst cuberite-8090c13cde2d61a0330f1e262de7526318a0965d.zip |
Diffstat (limited to '')
-rw-r--r-- | source/Blocks/BlockHandler.cpp | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp index 71d56f94d..991102aca 100644 --- a/source/Blocks/BlockHandler.cpp +++ b/source/Blocks/BlockHandler.cpp @@ -351,16 +351,7 @@ const char * cBlockHandler::GetStepSound() -bool cBlockHandler::CanBePlacedAt(cWorld *a_World, int a_BlockX, int a_BlockY, int a_BlockZ, char a_Dir)
-{
- return CanBeAt(a_World, a_BlockX, a_BlockY, a_BlockZ);
-}
-
-
-
-
-
-bool cBlockHandler::CanBeAt(cWorld *a_World, int a_BlockX, int a_BlockY, int a_BlockZ)
+bool cBlockHandler::CanBeAt(int a_BlockX, int a_BlockY, int a_BlockZ, const cChunk & a_Chunk)
{
return true;
}
@@ -423,21 +414,25 @@ bool cBlockHandler::DoesDropOnUnsuitable(void) -void cBlockHandler::Check(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ)
+void cBlockHandler::Check(int a_RelX, int a_RelY, int a_RelZ, cChunk & a_Chunk)
{
- if (!CanBeAt(a_World, a_BlockX, a_BlockY, a_BlockZ))
+ if (!CanBeAt(a_RelX, a_RelY, a_RelZ, a_Chunk))
{
if (DoesDropOnUnsuitable())
{
- DropBlock(a_World, NULL, a_BlockX, a_BlockY, a_BlockZ);
+ int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
+ int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
+ DropBlock(a_Chunk.GetWorld(), NULL, BlockX, a_RelY, BlockZ);
}
- a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
+ a_Chunk.SetBlock(a_RelX, a_RelY, a_RelZ, E_BLOCK_AIR, 0);
}
else
{
// Wake up the simulators for this block:
- a_World->WakeUpSimulators(a_BlockX, a_BlockY, a_BlockZ);
+ int BlockX = a_RelX + a_Chunk.GetPosX() * cChunkDef::Width;
+ int BlockZ = a_RelZ + a_Chunk.GetPosZ() * cChunkDef::Width;
+ a_Chunk.GetWorld()->GetSimulatorManager()->WakeUp(BlockX, a_RelY, BlockZ, &a_Chunk);
}
}
|