diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-08-29 15:56:40 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-08-29 15:56:40 +0200 |
commit | 431b7ed0b7764db732e39802a40d94dfe9f2108b (patch) | |
tree | f3f5ab4a7b1f2838733004d8294e571b777e631f /src/Protocol/Protocol14x.cpp | |
parent | Added new console command with cleanup (diff) | |
parent | VanillaFluidSimulator: Fixed an invalid Y-coord query. (diff) | |
download | cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.gz cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.bz2 cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.lz cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.xz cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.tar.zst cuberite-431b7ed0b7764db732e39802a40d94dfe9f2108b.zip |
Diffstat (limited to 'src/Protocol/Protocol14x.cpp')
-rw-r--r-- | src/Protocol/Protocol14x.cpp | 8 |
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); |