diff options
author | madmaxoft <github@xoft.cz> | 2014-07-10 18:18:32 +0200 |
---|---|---|
committer | madmaxoft <github@xoft.cz> | 2014-07-10 18:18:32 +0200 |
commit | 9e22f46b15d4c92bfbfdd5fb23d7530348f1d534 (patch) | |
tree | 8a5e25dcc2797a066e7d01f2f3d049095062b71e /src/Chunk.cpp | |
parent | Merge pull request #1159 from mc-server/VectorFloorFix (diff) | |
download | cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.gz cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.bz2 cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.lz cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.xz cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.tar.zst cuberite-9e22f46b15d4c92bfbfdd5fb23d7530348f1d534.zip |
Diffstat (limited to 'src/Chunk.cpp')
-rw-r--r-- | src/Chunk.cpp | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/src/Chunk.cpp b/src/Chunk.cpp index 0fee40cac..3f5165b7b 100644 --- a/src/Chunk.cpp +++ b/src/Chunk.cpp @@ -87,7 +87,8 @@ cChunk::cChunk( m_NeighborZM(a_NeighborZM), m_NeighborZP(a_NeighborZP), m_WaterSimulatorData(a_World->GetWaterSimulator()->CreateChunkData()), - m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()) + m_LavaSimulatorData (a_World->GetLavaSimulator ()->CreateChunkData()), + m_AlwaysTicked(0) { if (a_NeighborXM != NULL) { @@ -1641,6 +1642,31 @@ cBlockEntity * cChunk::GetBlockEntity(int a_BlockX, int a_BlockY, int a_BlockZ) +bool cChunk::ShouldBeTicked(void) const +{ + return (HasAnyClients() || (m_AlwaysTicked > 0)); +} + + + + + +void cChunk::SetAlwaysTicked(bool a_AlwaysTicked) +{ + if (a_AlwaysTicked) + { + m_AlwaysTicked += 1; + } + else + { + m_AlwaysTicked -= 1; + } +} + + + + + void cChunk::UseBlockEntity(cPlayer * a_Player, int a_X, int a_Y, int a_Z) { cBlockEntity * be = GetBlockEntity(a_X, a_Y, a_Z); @@ -1852,7 +1878,7 @@ bool cChunk::HasClient( cClientHandle* a_Client ) -bool cChunk::HasAnyClients(void) +bool cChunk::HasAnyClients(void) const { return !m_LoadedByClient.empty(); } |