diff options
author | Franz Reiter <franzi.moos@googlemail.com> | 2014-08-12 16:05:33 +0200 |
---|---|---|
committer | Franz Reiter <franzi.moos@googlemail.com> | 2014-08-12 16:05:33 +0200 |
commit | 8f0c4911f7564f6f8b73ad3f6920b2ac649f422d (patch) | |
tree | 8c4406712a9634f3b300fb79b1fb4f462f9b2b59 /src/World.h | |
parent | Merge pull request #1316 from ChriPiv/master (diff) | |
parent | Exported daylight cycle flag to the protocol. (diff) | |
download | cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.tar cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.tar.gz cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.tar.bz2 cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.tar.lz cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.tar.xz cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.tar.zst cuberite-8f0c4911f7564f6f8b73ad3f6920b2ac649f422d.zip |
Diffstat (limited to 'src/World.h')
-rw-r--r-- | src/World.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/World.h b/src/World.h index 90b798e8e..6df1758e9 100644 --- a/src/World.h +++ b/src/World.h @@ -145,7 +145,17 @@ public: // tolua_begin int GetTicksUntilWeatherChange(void) const { return m_WeatherInterval; } - + + /** Is the daylight cyclus enabled? */ + virtual bool IsDaylightCycleEnabled(void) const { return m_IsDaylightCycleEnabled; } + + /** Sets the daylight cyclus to true/false. */ + virtual void SetDaylightCycleEnabled(bool a_IsDaylightCycleEnabled) + { + m_IsDaylightCycleEnabled = a_IsDaylightCycleEnabled; + BroadcastTimeUpdate(); + } + virtual Int64 GetWorldAge (void) const override { return m_WorldAge; } virtual Int64 GetTimeOfDay(void) const override { return m_TimeOfDay; } @@ -158,6 +168,7 @@ public: { m_TimeOfDay = a_TimeOfDay; m_TimeOfDaySecs = (double)a_TimeOfDay / 20.0; + UpdateSkyDarkness(); BroadcastTimeUpdate(); } @@ -868,6 +879,7 @@ private: bool m_BroadcastDeathMessages; bool m_BroadcastAchievementMessages; + bool m_IsDaylightCycleEnabled; double m_WorldAgeSecs; // World age, in seconds. Is only incremented, cannot be set by plugins. double m_TimeOfDaySecs; // Time of day in seconds. Can be adjusted. Is wrapped to zero each day. Int64 m_WorldAge; // World age in ticks, calculated off of m_WorldAgeSecs |