summaryrefslogtreecommitdiffstats
path: root/source/World.cpp
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-12 05:46:01 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2013-01-12 05:46:01 +0100
commit43e684071933adef93040e8d4b830d5c6b71cf9a (patch)
tree014e5300feb1cdbbb8f24e4e42594eeb841f0be2 /source/World.cpp
parentFixed rclk in doublechests (diff)
downloadcuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.tar
cuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.tar.gz
cuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.tar.bz2
cuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.tar.lz
cuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.tar.xz
cuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.tar.zst
cuberite-43e684071933adef93040e8d4b830d5c6b71cf9a.zip
Diffstat (limited to 'source/World.cpp')
-rw-r--r--source/World.cpp82
1 files changed, 36 insertions, 46 deletions
diff --git a/source/World.cpp b/source/World.cpp
index 6eaf7a279..084bf8cd2 100644
--- a/source/World.cpp
+++ b/source/World.cpp
@@ -174,50 +174,6 @@ protected:
///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
// cWorld:
-cWorld* cWorld::GetWorld()
-{
- LOGWARN("WARNING: Using deprecated function cWorld::GetWorld() use cRoot::Get()->GetDefaultWorld() instead!");
- return cRoot::Get()->GetDefaultWorld();
-}
-
-
-
-
-
-cWorld::~cWorld()
-{
- {
- cCSLock Lock(m_CSEntities);
- while( m_AllEntities.begin() != m_AllEntities.end() )
- {
- cEntity* Entity = *m_AllEntities.begin();
- m_AllEntities.remove( Entity );
- if ( !Entity->IsDestroyed() )
- {
- Entity->Destroy();
- }
- delete Entity;
- }
- }
-
- delete m_SimulatorManager;
- delete m_SandSimulator;
- delete m_WaterSimulator;
- delete m_LavaSimulator;
- delete m_FireSimulator;
- delete m_RedstoneSimulator;
-
- UnloadUnusedChunks();
-
- m_Storage.WaitForFinish();
-
- delete m_ChunkMap;
-}
-
-
-
-
-
cWorld::cWorld(const AString & a_WorldName) :
m_WorldAgeSecs(0),
m_TimeOfDaySecs(0),
@@ -317,6 +273,40 @@ cWorld::cWorld(const AString & a_WorldName) :
+cWorld::~cWorld()
+{
+ {
+ cCSLock Lock(m_CSEntities);
+ while( m_AllEntities.begin() != m_AllEntities.end() )
+ {
+ cEntity* Entity = *m_AllEntities.begin();
+ m_AllEntities.remove( Entity );
+ if ( !Entity->IsDestroyed() )
+ {
+ Entity->Destroy();
+ }
+ delete Entity;
+ }
+ }
+
+ delete m_SimulatorManager;
+ delete m_SandSimulator;
+ delete m_WaterSimulator;
+ delete m_LavaSimulator;
+ delete m_FireSimulator;
+ delete m_RedstoneSimulator;
+
+ UnloadUnusedChunks();
+
+ m_Storage.WaitForFinish();
+
+ delete m_ChunkMap;
+}
+
+
+
+
+
void cWorld::SetWeather(eWeather a_Weather)
{
switch (a_Weather)
@@ -1064,14 +1054,14 @@ int cWorld::GetBiomeAt (int a_BlockX, int a_BlockZ)
void cWorld::SetBlock(int a_BlockX, int a_BlockY, int a_BlockZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta)
{
- if(a_BlockType == E_BLOCK_AIR)
+ if (a_BlockType == E_BLOCK_AIR)
{
BlockHandler(GetBlock(a_BlockX, a_BlockY, a_BlockZ))->OnDestroyed(this, a_BlockX, a_BlockY, a_BlockZ);
}
m_ChunkMap->SetBlock(a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
GetSimulatorManager()->WakeUp(a_BlockX, a_BlockY, a_BlockZ);
- BlockHandler(a_BlockType)->OnPlaced(this, a_BlockX, a_BlockY, a_BlockZ, a_BlockMeta);
+ BlockHandler(a_BlockType)->OnPlaced(this, a_BlockX, a_BlockY, a_BlockZ, a_BlockType, a_BlockMeta);
}