summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
authorLane Kolbly <lane@rscheme.org>2017-09-07 14:41:16 +0200
committerAlexander Harkness <me@bearbin.net>2017-09-07 14:41:16 +0200
commitb12f4ef7d58cfe4d815feb2db1f88f223c7f2a61 (patch)
treec7e2a8db5676c8599ce76b212491dd35fd883c1c /src/World.h
parentLighting now generally consistent with vanilla (#3988) (diff)
downloadcuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar
cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.gz
cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.bz2
cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.lz
cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.xz
cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.tar.zst
cuberite-b12f4ef7d58cfe4d815feb2db1f88f223c7f2a61.zip
Diffstat (limited to '')
-rw-r--r--src/World.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/World.h b/src/World.h
index 87110a5cf..22847b975 100644
--- a/src/World.h
+++ b/src/World.h
@@ -12,6 +12,7 @@
#include "ChunkSender.h"
#include "Defines.h"
#include "LightingThread.h"
+#include "IniFile.h"
#include "Item.h"
#include "Mobs/Monster.h"
#include "Entities/ProjectileEntity.h"
@@ -103,6 +104,12 @@ public:
// tolua_begin
+ /** Get whether saving chunks is enabled */
+ bool IsSavingEnabled(void) const { return m_IsSavingEnabled; }
+
+ /** Set whether saving chunks is enabled */
+ void SetSavingEnabled(bool a_IsSavingEnabled) { m_IsSavingEnabled = a_IsSavingEnabled; }
+
int GetTicksUntilWeatherChange(void) const { return m_WeatherInterval; }
/** Is the daylight cycle enabled? */
@@ -657,6 +664,9 @@ public:
/** Returns the name of the world */
const AString & GetName(void) const { return m_WorldName; }
+ /** Returns the data path to the world data */
+ const AString & GetDataPath(void) const { return m_DataPath; }
+
/** Returns the name of the world.ini file used by this world */
const AString & GetIniFileName(void) const {return m_IniFileName; }
@@ -900,6 +910,9 @@ private:
AString m_WorldName;
+ /** The path to the root directory for the world files. Does not including trailing path specifier. */
+ AString m_DataPath;
+
/** The name of the overworld that portals in this world should link to.
Only has effect if this world is a Nether or End world. */
AString m_LinkedOverworldName;
@@ -911,6 +924,9 @@ private:
int m_StorageCompressionFactor;
+ /** Whether or not writing chunks to disk is currently enabled */
+ std::atomic<bool> m_IsSavingEnabled;
+
/** The dimension of the world, used by the client to provide correct lighting scheme */
eDimension m_Dimension;
@@ -1065,7 +1081,7 @@ private:
cSetChunkDataPtrs m_SetChunkDataQueue;
- cWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_LinkedOverworldName = "");
+ cWorld(const AString & a_WorldName, const AString & a_DataPath, eDimension a_Dimension = dimOverworld, const AString & a_LinkedOverworldName = "");
virtual ~cWorld() override;
void Tick(std::chrono::milliseconds a_Dt, std::chrono::milliseconds a_LastTickDurationMSec);