summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorTycho Bickerstaff <work.tycho@gmail.com>2013-12-11 00:01:35 +0100
committerTycho Bickerstaff <work.tycho@gmail.com>2013-12-11 00:01:35 +0100
commitdd633d5a947771cd37f8a853ceb44660752a7e3c (patch)
tree0141233cb7025eaca681513b6670b325c76f57c1 /src/Root.cpp
parentadded tolua++ command and removed stackwalker from build (diff)
parentMerge branch 'master' of https://github.com/mc-server/MCServer (diff)
downloadcuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.gz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.bz2
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.lz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.xz
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.tar.zst
cuberite-dd633d5a947771cd37f8a853ceb44660752a7e3c.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);
}
}