From fbc497b97dfb05f226235a9dcf6cd61b7de0eeda Mon Sep 17 00:00:00 2001 From: "madmaxoft@gmail.com" Date: Sun, 27 May 2012 14:05:36 +0000 Subject: [PATCH] DebugBiomes composition generator now uses only blocks suitable for terrain (from an internal list) git-svn-id: http://mc-server.googlecode.com/svn/trunk@510 0a769ca7-a7f5-676a-18bf-c427514a06d6 --- source/CompoGen.cpp | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/source/CompoGen.cpp b/source/CompoGen.cpp index 9d98d2332..f340e0ad4 100644 --- a/source/CompoGen.cpp +++ b/source/CompoGen.cpp @@ -67,6 +67,33 @@ void cCompoGenDebugBiomes::ComposeTerrain( cBlockEntityList & a_BlockEntities // Block entitites may be generated (chests / furnaces / ...) ) { + static BLOCKTYPE Blocks[] = + { + E_BLOCK_STONE, + E_BLOCK_COBBLESTONE, + E_BLOCK_LOG, + E_BLOCK_PLANKS, + E_BLOCK_SANDSTONE, + E_BLOCK_WHITE_CLOTH, + E_BLOCK_COAL_ORE, + E_BLOCK_IRON_ORE, + E_BLOCK_GOLD_ORE, + E_BLOCK_DIAMOND_ORE, + E_BLOCK_LAPIS_ORE, + E_BLOCK_REDSTONE_ORE, + E_BLOCK_IRON_BLOCK, + E_BLOCK_GOLD_BLOCK, + E_BLOCK_DIAMOND_BLOCK, + E_BLOCK_LAPIS_BLOCK, + E_BLOCK_BRICK, + E_BLOCK_MOSSY_COBBLESTONE, + E_BLOCK_OBSIDIAN, + E_BLOCK_NETHERRACK, + E_BLOCK_SOULSAND, + E_BLOCK_NETHER_BRICK, + E_BLOCK_BEDROCK, + } ; + memset(a_BlockTypes, E_BLOCK_AIR, sizeof(a_BlockTypes)); memset(a_BlockMeta, 0, sizeof(a_BlockMeta)); @@ -77,7 +104,7 @@ void cCompoGenDebugBiomes::ComposeTerrain( { for (int x = 0; x < cChunkDef::Width; x++) { - BLOCKTYPE BlockType = (BLOCKTYPE)cChunkDef::GetBiome(BiomeMap, x, z); + BLOCKTYPE BlockType = Blocks[cChunkDef::GetBiome(BiomeMap, x, z) % ARRAYCOUNT(Blocks)]; for (int y = a_HeightMap[x + cChunkDef::Width * z]; y >= 0; y--) { cChunkDef::SetBlock(a_BlockTypes, x, y, z, BlockType);