1
0

Added SetDoDaylightCycle() and IsDaylightCycleEnabled() to cWorld.

I need this for a GameRule plugin.
This commit is contained in:
Howaner
2014-08-07 01:07:32 +02:00
parent eae42d91f9
commit 4271d719b6
4 changed files with 58 additions and 22 deletions

View File

@@ -342,7 +342,16 @@ void cClientHandle::Authenticate(const AString & a_Name, const AString & a_UUID,
}
// Send time
m_Protocol->SendTimeUpdate(World->GetWorldAge(), World->GetTimeOfDay());
Int64 TimeOfDay = World->GetTimeOfDay();
if (!World->IsDaylightCycleEnabled())
{
TimeOfDay *= -1;
if (TimeOfDay == 0)
{
TimeOfDay = -1;
}
}
m_Protocol->SendTimeUpdate(World->GetWorldAge(), TimeOfDay);
// Send contents of the inventory window
m_Protocol->SendWholeInventory(*m_Player->GetWindow());