From 47c928cab7d1ff73e50925bc7ef50586b6ec9821 Mon Sep 17 00:00:00 2001 From: Howaner Date: Mon, 11 Aug 2014 00:20:28 +0200 Subject: Exported daylight cycle flag to the protocol. --- src/Protocol/Protocol17x.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/Protocol/Protocol17x.cpp') diff --git a/src/Protocol/Protocol17x.cpp b/src/Protocol/Protocol17x.cpp index 318342f09..a724133fc 100644 --- a/src/Protocol/Protocol17x.cpp +++ b/src/Protocol/Protocol17x.cpp @@ -1286,9 +1286,14 @@ void cProtocol172::SendThunderbolt(int a_BlockX, int a_BlockY, int a_BlockZ) -void cProtocol172::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay) +void cProtocol172::SendTimeUpdate(Int64 a_WorldAge, Int64 a_TimeOfDay, bool a_DoDaylightCycle) { ASSERT(m_State == 3); // In game mode? + 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); + } cPacketizer Pkt(*this, 0x03); Pkt.WriteInt64(a_WorldAge); -- cgit v1.2.3