diff options
author | worktycho <work.tycho@gmail.com> | 2014-09-26 17:04:26 +0200 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2014-09-26 17:04:26 +0200 |
commit | 411c69b420acdc1e103a76a1a52e2c488aee5718 (patch) | |
tree | 06e33fb4b17d9c782ebb834a9821571f11ae103c /src/Simulator/Simulator.inc | |
parent | Improved searching for spawn. (diff) | |
parent | Merge branch 'master' into redstoneTests (diff) | |
download | cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.gz cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.bz2 cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.lz cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.xz cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.tar.zst cuberite-411c69b420acdc1e103a76a1a52e2c488aee5718.zip |
Diffstat (limited to 'src/Simulator/Simulator.inc')
-rw-r--r-- | src/Simulator/Simulator.inc | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/Simulator/Simulator.inc b/src/Simulator/Simulator.inc new file mode 100644 index 000000000..511a6b4c2 --- /dev/null +++ b/src/Simulator/Simulator.inc @@ -0,0 +1,45 @@ + + +#include "Simulator.h" + + + + +template <class ChunkType, class WorldType> +cSimulator<ChunkType, WorldType>::cSimulator(WorldType & a_World) + : m_World(a_World) +{ +} + + + + +template <class ChunkType, class WorldType> +cSimulator<ChunkType, WorldType>::~cSimulator() +{ +} + + + + +template <class ChunkType, class WorldType> +void cSimulator<ChunkType, WorldType>::WakeUp(int a_BlockX, int a_BlockY, int a_BlockZ, ChunkType * a_Chunk) +{ + AddBlock(a_BlockX, a_BlockY, a_BlockZ, a_Chunk); + AddBlock(a_BlockX - 1, a_BlockY, a_BlockZ, a_Chunk->GetNeighborChunk(a_BlockX - 1, a_BlockZ)); + AddBlock(a_BlockX + 1, a_BlockY, a_BlockZ, a_Chunk->GetNeighborChunk(a_BlockX + 1, a_BlockZ)); + AddBlock(a_BlockX, a_BlockY, a_BlockZ - 1, a_Chunk->GetNeighborChunk(a_BlockX, a_BlockZ - 1)); + AddBlock(a_BlockX, a_BlockY, a_BlockZ + 1, a_Chunk->GetNeighborChunk(a_BlockX, a_BlockZ + 1)); + if (a_BlockY > 0) + { + AddBlock(a_BlockX, a_BlockY - 1, a_BlockZ, a_Chunk); + } + if (a_BlockY < cChunkDef::Height - 1) + { + AddBlock(a_BlockX, a_BlockY + 1, a_BlockZ, a_Chunk); + } +} + + + + |