summaryrefslogtreecommitdiffstats
path: root/src/Protocol/Protocol14x.cpp
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-20 22:25:05 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-20 22:25:05 +0200
commitf7774ec33638bfc30cc29c1f70850a6072a31c93 (patch)
treec2c2896b87de9241b1555e4e2580aa6b3f401870 /src/Protocol/Protocol14x.cpp
parentRevert "Removes the fire if the block under the fire was broken." (diff)
parentMerge pull request #1335 from mc-server/CodeFixes (diff)
downloadcuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.tar
cuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.tar.gz
cuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.tar.bz2
cuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.tar.lz
cuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.tar.xz
cuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.tar.zst
cuberite-f7774ec33638bfc30cc29c1f70850a6072a31c93.zip
Diffstat (limited to 'src/Protocol/Protocol14x.cpp')
-rw-r--r--src/Protocol/Protocol14x.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/Protocol/Protocol14x.cpp b/src/Protocol/Protocol14x.cpp
index 8b177ea48..3b6b6a42a 100644
--- a/src/Protocol/Protocol14x.cpp
+++ b/src/Protocol/Protocol14x.cpp
@@ -130,8 +130,14 @@ void cProtocol142::SendSoundParticleEffect(int a_EffectID, int a_SrcX, int a_Src
-void cProtocol142::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay)
+void cProtocol142::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle)
{
+ if (!a_DoDaylightCycle)
+ {
+ // When writing a "-" before the number the client ignores it but it will stop the client-side time expiration.
+ a_TimeOfDay = std::min(-a_TimeOfDay, -1LL);
+ }
+
cCSLock Lock(m_CSPacket);
WriteByte (PACKET_UPDATE_TIME);
WriteInt64(a_WorldAge);