summaryrefslogtreecommitdiffstats
path: root/source/cChunkGenerator.cpp
diff options
context:
space:
mode:
authorcedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-08 03:56:44 +0200
committercedeel@gmail.com <cedeel@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-06-08 03:56:44 +0200
commit2295c1d7cba3df6f7fc2e96b0d25df116d0b1692 (patch)
treea25a3245f357f7e216a8949f836a98bd27eab938 /source/cChunkGenerator.cpp
parentFixed the nightbuild script for automatic Bindings generation (diff)
downloadcuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.tar
cuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.tar.gz
cuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.tar.bz2
cuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.tar.lz
cuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.tar.xz
cuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.tar.zst
cuberite-2295c1d7cba3df6f7fc2e96b0d25df116d0b1692.zip
Diffstat (limited to '')
-rw-r--r--source/cChunkGenerator.cpp20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/cChunkGenerator.cpp b/source/cChunkGenerator.cpp
index 14008add7..d595f333f 100644
--- a/source/cChunkGenerator.cpp
+++ b/source/cChunkGenerator.cpp
@@ -224,6 +224,17 @@ void cChunkGenerator::InitHeightGen(cIniFile & a_IniFile)
+BLOCKTYPE ResolveBlock(AString BlockType, BLOCKTYPE DefaultBlock)
+{
+ int Block = BlockStringToType(BlockType);
+ if(Block < 0)
+ {
+ LOGWARN("[Generator] Could not parse block value \"%s\". Using default.", BlockType.c_str());
+ return DefaultBlock;
+ }
+ return (BLOCKTYPE) Block;
+}
+
void cChunkGenerator::InitCompositionGen(cIniFile & a_IniFile)
@@ -260,7 +271,14 @@ void cChunkGenerator::InitCompositionGen(cIniFile & a_IniFile)
int SeaLevel = a_IniFile.GetValueI("Generator", "ClassicSeaLevel", 60);
int BeachHeight = a_IniFile.GetValueI("Generator", "ClassicBeachHeight", 2);
int BeachDepth = a_IniFile.GetValueI("Generator", "ClassicBeachDepth", 4);
- m_CompositionGen = new cCompoGenClassic(SeaLevel, BeachHeight, BeachDepth);
+ BLOCKTYPE BlockTop = ResolveBlock(a_IniFile.GetValue("Generator", "ClassicBlockTop", "grass"), E_BLOCK_GRASS);
+ BLOCKTYPE BlockMiddle = ResolveBlock(a_IniFile.GetValue("Generator", "ClassicBlockMiddle", "dirt"), E_BLOCK_DIRT);
+ BLOCKTYPE BlockBottom = ResolveBlock(a_IniFile.GetValue("Generator", "ClassicBlockBottom", "stone"), E_BLOCK_STONE);
+ BLOCKTYPE BlockBeach = ResolveBlock(a_IniFile.GetValue("Generator", "ClassicBlockBeach", "sand"), E_BLOCK_SAND);
+ BLOCKTYPE BlockBeachBottom = ResolveBlock(a_IniFile.GetValue("Generator", "ClassicBlockBeachBottom", "sandstone"), E_BLOCK_SANDSTONE);
+ BLOCKTYPE BlockSea = ResolveBlock(a_IniFile.GetValue("Generator", "ClassicBlockSea", "9"), E_BLOCK_STATIONARY_WATER);
+ m_CompositionGen = new cCompoGenClassic(SeaLevel, BeachHeight, BeachDepth, BlockTop, BlockMiddle, BlockBottom, BlockBeach,
+ BlockBeachBottom, BlockSea);
}
else
{