summaryrefslogtreecommitdiffstats
path: root/src/Root.cpp
diff options
context:
space:
mode:
authorBond-009 <Bond-009@users.noreply.github.com>2017-02-24 10:02:16 +0100
committerMattes D <github@xoft.cz>2017-02-24 10:02:16 +0100
commitca3aa4ca0682f3f798765b1ee172346ba2209537 (patch)
tree81ef2a19c22fcacdaaffa34cc879d28c49db3760 /src/Root.cpp
parentFinishers now update the heightmap for tall flowers. (#3545) (diff)
downloadcuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.tar
cuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.tar.gz
cuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.tar.bz2
cuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.tar.lz
cuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.tar.xz
cuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.tar.zst
cuberite-ca3aa4ca0682f3f798765b1ee172346ba2209537.zip
Diffstat (limited to 'src/Root.cpp')
-rw-r--r--src/Root.cpp37
1 files changed, 26 insertions, 11 deletions
diff --git a/src/Root.cpp b/src/Root.cpp
index 508d0a648..30644a741 100644
--- a/src/Root.cpp
+++ b/src/Root.cpp
@@ -382,11 +382,11 @@ void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIn
{
a_Settings.AddValue("Worlds", "DefaultWorld", "world");
a_Settings.AddValue("Worlds", "World", "world_nether");
- a_Settings.AddValue("Worlds", "World", "world_end");
+ a_Settings.AddValue("Worlds", "World", "world_the_end");
m_pDefaultWorld = new cWorld("world");
m_WorldsByName["world"] = m_pDefaultWorld;
m_WorldsByName["world_nether"] = new cWorld("world_nether", dimNether, "world");
- m_WorldsByName["world_end"] = new cWorld("world_end", dimEnd, "world");
+ m_WorldsByName["world_the_end"] = new cWorld("world_the_end", dimEnd, "world");
return;
}
@@ -411,15 +411,15 @@ void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIn
- If a world called x exists, set it as x_nether's overworld.
- Otherwise set the default world as x_nether's overworld.
- - If the world name is x_end, create a world.ini with the dimension type "end".
- - If a world called x exists, set it as x_end's overworld.
- - Otherwise set the default world as x_end's overworld.
+ - If the world name is x_the_end or x_end, create a world.ini with the dimension type "end".
+ - If a world called x exists, set it as x_the_end's overworld.
+ - Otherwise set the default world as x_the_end's overworld.
- - If the world name is x (and doesn't end with _end or _nether)
+ - If the world name is x (and doesn't end with _the_end, _end or _nether)
- Create a world.ini with a dimension type of "overworld".
- If a world called x_nether exists, set it as x's nether world.
- Otherwise set x's nether world to blank.h
- - If a world called x_end exists, set it as x's end world.
+ - If a world called x_the_end or x_end exists, set it as x's end world.
- Otherwise set x's nether world to blank.
*/
@@ -440,8 +440,9 @@ void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIn
FoundAdditionalWorlds = true;
cWorld * NewWorld;
AString LowercaseName = StrToLower(WorldName);
- AString NetherAppend="_nether";
- AString EndAppend="_end";
+ AString NetherAppend = "_nether";
+ AString EndAppend1 = "_the_end";
+ AString EndAppend2 = "_end";
// if the world is called x_nether
if ((LowercaseName.size() > NetherAppend.size()) && (LowercaseName.substr(LowercaseName.size() - NetherAppend.size()) == NetherAppend))
@@ -457,14 +458,28 @@ void cRoot::LoadWorlds(cSettingsRepositoryInterface & a_Settings, bool a_IsNewIn
}
NewWorld = new cWorld(WorldName.c_str(), dimNether, LinkTo);
}
+ // if the world is called x_the_end
+ else if ((LowercaseName.size() > EndAppend1.size()) && (LowercaseName.substr(LowercaseName.size() - EndAppend1.size()) == EndAppend1))
+ {
+ // The world is called x_the_end, see if a world called x exists. If yes, choose it as the linked world,
+ // otherwise, choose the default world as the linked world.
+ // As before, any ini settings will completely override this if an ini is already present.
+
+ AString LinkTo = WorldName.substr(0, WorldName.size() - EndAppend1.size());
+ if (GetWorld(LinkTo) == nullptr)
+ {
+ LinkTo = DefaultWorldName;
+ }
+ NewWorld = new cWorld(WorldName.c_str(), dimEnd, LinkTo);
+ }
// if the world is called x_end
- else if ((LowercaseName.size() > EndAppend.size()) && (LowercaseName.substr(LowercaseName.size() - EndAppend.size()) == EndAppend))
+ else if ((LowercaseName.size() > EndAppend2.size()) && (LowercaseName.substr(LowercaseName.size() - EndAppend2.size()) == EndAppend2))
{
// The world is called x_end, see if a world called x exists. If yes, choose it as the linked world,
// otherwise, choose the default world as the linked world.
// As before, any ini settings will completely override this if an ini is already present.
- AString LinkTo = WorldName.substr(0, WorldName.size() - EndAppend.size());
+ AString LinkTo = WorldName.substr(0, WorldName.size() - EndAppend2.size());
if (GetWorld(LinkTo) == nullptr)
{
LinkTo = DefaultWorldName;