summaryrefslogtreecommitdiffstats
path: root/source/Blocks/BlockFluid.h
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/BlockFluid.h
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 'source/Blocks/BlockFluid.h')
-rw-r--r--source/Blocks/BlockFluid.h21
1 files changed, 20 insertions, 1 deletions
diff --git a/source/Blocks/BlockFluid.h b/source/Blocks/BlockFluid.h
index 40ff621e4..a8cd9c497 100644
--- a/source/Blocks/BlockFluid.h
+++ b/source/Blocks/BlockFluid.h
@@ -10,6 +10,8 @@
class cBlockFluidHandler :
public cBlockHandler
{
+ typedef cBlockHandler super;
+
public:
cBlockFluidHandler(BLOCKTYPE a_BlockType)
: cBlockHandler(a_BlockType)
@@ -23,7 +25,24 @@ public:
return true;
}
- // TODO: Implement proper fluid physics here
+
+ virtual void Check(cWorld * a_World, int a_BlockX, int a_BlockY, int a_BlockZ) override
+ {
+ switch (m_BlockType)
+ {
+ case E_BLOCK_STATIONARY_LAVA:
+ {
+ a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_LAVA, a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ));
+ break;
+ }
+ case E_BLOCK_STATIONARY_WATER:
+ {
+ a_World->FastSetBlock(a_BlockX, a_BlockY, a_BlockZ, E_BLOCK_WATER, a_World->GetBlockMeta(a_BlockX, a_BlockY, a_BlockZ));
+ break;
+ }
+ }
+ super::Check(a_World, a_BlockX, a_BlockY, a_BlockZ);
+ }
} ;