summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorMattes D <github@xoft.cz>2013-12-11 17:02:45 +0100
committerMattes D <github@xoft.cz>2013-12-11 17:02:45 +0100
commit7035d31e9d8f4d25efc722cb3d2a49fb756249ee (patch)
tree75dd002246aa046a67c6675e9f3a4f93bb644e33 /src/Root.cpp
parentExpOrbs now move. (diff)
parentHOOK_WORLD_STARTED now gets called when the CreateAndInitializeWorld function is used. (diff)
downloadcuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.tar
cuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.tar.gz
cuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.tar.bz2
cuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.tar.lz
cuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.tar.xz
cuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.tar.zst
cuberite-7035d31e9d8f4d25efc722cb3d2a49fb756249ee.zip
Diffstat (limited to 'src/Root.cpp')
-rw-r--r--src/Root.cpp19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index c99bf76b7..fb1e96426 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -299,12 +299,31 @@ void cRoot::LoadWorlds(cIniFile & IniFile)
+cWorld * cRoot::CreateAndInitializeWorld(const AString & a_WorldName)
+{
+ if (m_WorldsByName[a_WorldName] != NULL)
+ {
+ return NULL;
+ }
+ cWorld* NewWorld = new cWorld(a_WorldName.c_str());
+ m_WorldsByName[a_WorldName] = NewWorld;
+ NewWorld->Start();
+ NewWorld->InitializeSpawn();
+ m_PluginManager->CallHookWorldStarted(*NewWorld);
+ return NewWorld;
+}
+
+
+
+
+
void cRoot::StartWorlds(void)
{
for (WorldMap::iterator itr = m_WorldsByName.begin(); itr != m_WorldsByName.end(); ++itr)
{
itr->second->Start();
itr->second->InitializeSpawn();
+ m_PluginManager->CallHookWorldStarted(*itr->second);
}
}