summaryrefslogtreecommitdiffstats
path: root/src/Chunk.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-07-10 18:18:32 +0200
committermadmaxoft <github@xoft.cz>2014-07-10 18:18:32 +0200
commit9e22f46b15d4c92bfbfdd5fb23d7530348f1d534 (patch)
tree8a5e25dcc2797a066e7d01f2f3d049095062b71e /src/Chunk.cpp
parentMerge pull request #1159 from mc-server/VectorFloorFix (diff)
downloadcuberite-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 '')
-rw-r--r--src/Chunk.cpp30
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();
}