summaryrefslogtreecommitdiffstats
path: root/src/World.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/World.h')
-rw-r--r--src/World.h47
1 files changed, 39 insertions, 8 deletions
diff --git a/src/World.h b/src/World.h
index 2b7f78760..645ae122c 100644
--- a/src/World.h
+++ b/src/World.h
@@ -180,7 +180,7 @@ public:
virtual eDimension GetDimension(void) const { return m_Dimension; }
/** Returns the world height at the specified coords; waits for the chunk to get loaded / generated */
- int GetHeight(int a_BlockX, int a_BlockZ);
+ virtual int GetHeight(int a_BlockX, int a_BlockZ);
// tolua_end
@@ -313,9 +313,6 @@ public:
bool HasEntity(int a_UniqueID);
- /** Removes the entity, the entity ptr ownership is assumed taken by the caller */
- void RemoveEntity(cEntity * a_Entity);
-
/** Calls the callback for each entity in the entire world; returns true if all entities processed, false if the callback aborted by returning true */
bool ForEachEntity(cEntityCallback & a_Callback); // Exported in ManualBindings.cpp
@@ -631,6 +628,21 @@ public:
bool ShouldUseChatPrefixes(void) const { return m_bUseChatPrefixes; }
void SetShouldUseChatPrefixes(bool a_Flag) { m_bUseChatPrefixes = a_Flag; }
+
+ bool AreNetherPortalsEnabled(void) const { return m_bNetherPortalsEnabled; }
+ void SetNetherPortalsEnabled(bool a_Flag) { m_bNetherPortalsEnabled = a_Flag; }
+
+ bool AreEndPortalsEnabled(void) const { return m_bEndPortalsEnabled; }
+ void SetEndPortalsEnabled(bool a_Flag) { m_bEndPortalsEnabled = a_Flag; }
+
+ AString GetNetherWorldName(void) const { return m_NetherWorldName; }
+ void SetNetherWorldName(const AString & a_Name) { m_NetherWorldName = a_Name; }
+
+ AString GetEndWorldName(void) const { return m_EndWorldName; }
+ void SetEndWorldName(const AString & a_Name) { m_EndWorldName = a_Name; }
+
+ AString GetLinkedOverworldName(void) const { return m_OverworldName; }
+ void SetLinkedOverworldName(const AString & a_Name) { m_OverworldName = a_Name; }
// tolua_end
@@ -674,7 +686,7 @@ public:
void InitializeSpawn(void);
/** Starts threads that belong to this world */
- void Start(void);
+ void Start(bool a_WasDimensionSet = true);
/** Stops threads that belong to this world (part of deinit) */
void Stop(void);
@@ -726,7 +738,7 @@ public:
/** Returns true if the current weather is stormy */
bool IsWeatherStorm(void) const { return (m_Weather == wStorm); }
-
+
/** Returns true if the weather is stormy at the specified location. This takes into account biomes. */
bool IsWeatherStormAt(int a_BlockX, int a_BlockZ)
{
@@ -737,10 +749,11 @@ public:
bool IsWeatherWet(void) const { return !IsWeatherSunny(); }
/** Returns true if it is raining, stormy or snowing at the specified location. This takes into account biomes. */
- bool IsWeatherWetAt(int a_BlockX, int a_BlockZ)
+ virtual bool IsWeatherWetAt(int a_BlockX, int a_BlockZ)
{
return (IsWeatherWet() && !IsBiomeNoDownfall(GetBiomeAt(a_BlockX, a_BlockZ)));
}
+
// tolua_end
cChunkGenerator & GetGenerator(void) { return m_Generator; }
@@ -838,6 +851,12 @@ private:
AString m_WorldName;
+
+ /** The name of the world that a portal in this world should link to
+ Only has effect if this world is a nether or end world, as it is used by entities to see which world to teleport to when in a portal
+ */
+ AString m_OverworldName;
+
AString m_IniFileName;
/** Name of the storage schema used to load and save chunks */
@@ -922,6 +941,18 @@ private:
See the eShrapnelLevel enumeration for details
*/
eShrapnelLevel m_TNTShrapnelLevel;
+
+ /** Whether nether portals teleport entities */
+ bool m_bNetherPortalsEnabled;
+
+ /** Whether end portals teleport entities */
+ bool m_bEndPortalsEnabled;
+
+ /** Name of the nether world */
+ AString m_NetherWorldName;
+
+ /** Name of the end world */
+ AString m_EndWorldName;
cChunkGenerator m_Generator;
@@ -975,7 +1006,7 @@ private:
cPlayerList m_PlayersToAdd;
- cWorld(const AString & a_WorldName);
+ cWorld(const AString & a_WorldName, eDimension a_Dimension = dimOverworld, const AString & a_OverworldName = "");
virtual ~cWorld();
void Tick(float a_Dt, int a_LastTickDurationMSec);