summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2014-08-07 01:07:32 +0200
committerHowaner <franzi.moos@googlemail.com>2014-08-07 01:07:32 +0200
commit4271d719b68521f91770574b3064525512116670 (patch)
tree2b71382d4917b6131cb8c3cffa94501063c81512 /src/World.h
parentMerge pull request #1291 from mc-server/RedstoneCleanUp (diff)
downloadcuberite-4271d719b68521f91770574b3064525512116670.tar
cuberite-4271d719b68521f91770574b3064525512116670.tar.gz
cuberite-4271d719b68521f91770574b3064525512116670.tar.bz2
cuberite-4271d719b68521f91770574b3064525512116670.tar.lz
cuberite-4271d719b68521f91770574b3064525512116670.tar.xz
cuberite-4271d719b68521f91770574b3064525512116670.tar.zst
cuberite-4271d719b68521f91770574b3064525512116670.zip
Diffstat (limited to '')
-rw-r--r--src/World.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/World.h b/src/World.h
index 90b798e8e..8ddc69118 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_DoDaylightCycle; }
+
+ /** Sets the daylight cyclus to true/false. */
+ virtual void SetDoDaylightCycle(bool a_DoDaylightCycle)
+ {
+ m_DoDaylightCycle = a_DoDaylightCycle;
+ 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_DoDaylightCycle; // Is the daylight cyclus enabled?
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