1
0

Added the End height and composition generators.

Also made the dimension in world.ini specifiable by a string. Exported StringToDimension() and StringToBiome() to Lua API.

git-svn-id: http://mc-server.googlecode.com/svn/trunk@1621 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
madmaxoft@gmail.com
2013-06-22 18:41:08 +00:00
parent c8fc397b43
commit 9dd0486faf
11 changed files with 445 additions and 24 deletions

View File

@@ -290,6 +290,7 @@ EMCSBiome StringToBiome(const AString & a_BiomeString)
{biHell, "Hell"},
{biHell, "Nether"},
{biSky, "Sky"},
{biSky, "End"},
{biFrozenOcean, "FrozenOcean"},
{biFrozenRiver, "FrozenRiver"},
{biIcePlains, "IcePlains"},
@@ -320,6 +321,46 @@ EMCSBiome StringToBiome(const AString & a_BiomeString)
eDimension StringToDimension(const AString & a_DimensionString)
{
int res = atoi(a_DimensionString.c_str());
if ((res != 0) || (a_DimensionString == "0"))
{
// It was a valid number
return (eDimension)res;
}
// Convert using a built-in map:
static struct
{
eDimension m_Dimension;
const char * m_String;
} DimensionMap [] =
{
{ dimOverworld, "Overworld"},
{ dimOverworld, "Normal"},
{ dimOverworld, "World"},
{ dimNether, "Nether"},
{ dimNether, "Hell"}, // Alternate name for End
{ dimEnd, "End"},
{ dimEnd, "Sky"}, // Old name for End
} ;
for (int i = 0; i < ARRAYCOUNT(DimensionMap); i++)
{
if (NoCaseCompare(DimensionMap[i].m_String, a_DimensionString) == 0)
{
return DimensionMap[i].m_Dimension;
}
} // for i - DimensionMap[]
// Not found
return (eDimension)-1000;
}
// This is actually just some code that needs to run at program startup, so it is wrapped into a global var's constructor:
class cBlockPropertiesInitializer
{