summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockHandler.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-14 20:30:16 +0200
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-10-14 20:30:16 +0200
commit41a38e8d9098d6627cd26351577cf032e6996c87 (patch)
tree34d53e6291c6d353a9c3a37a472b933f9fa5e57d /source/Blocks/BlockHandler.cpp
parentInitial Floody fluid simulator. (diff)
downloadcuberite-41a38e8d9098d6627cd26351577cf032e6996c87.tar
cuberite-41a38e8d9098d6627cd26351577cf032e6996c87.tar.gz
cuberite-41a38e8d9098d6627cd26351577cf032e6996c87.tar.bz2
cuberite-41a38e8d9098d6627cd26351577cf032e6996c87.tar.lz
cuberite-41a38e8d9098d6627cd26351577cf032e6996c87.tar.xz
cuberite-41a38e8d9098d6627cd26351577cf032e6996c87.tar.zst
cuberite-41a38e8d9098d6627cd26351577cf032e6996c87.zip
Diffstat (limited to '')
-rw-r--r--source/Blocks/BlockHandler.cpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/source/Blocks/BlockHandler.cpp b/source/Blocks/BlockHandler.cpp
index 977bff87f..eb7a40d62 100644
--- a/source/Blocks/BlockHandler.cpp
+++ b/source/Blocks/BlockHandler.cpp
@@ -387,3 +387,25 @@ bool cBlockHandler::DoesDropOnUnsuitable(void)
+
+void cBlockHandler::Check(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ)
+{
+ if (!CanBeAt(a_World, a_BlockX, a_BlockY, a_BlockZ))
+ {
+ if (DoesDropOnUnsuitable())
+ {
+ DropBlock(a_World, a_BlockX, a_BlockY, a_BlockZ);
+ }
+
+ a_World->SetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_AIR, 0);
+ }
+ else
+ {
+ // Wake up the simulators:
+ a_World->GetSimulatorManager()->WakeUp(a_BlockX, a_BlockY, a_BlockZ);
+ }
+}
+
+
+
+