summaryrefslogtreecommitdiffstats
path: root/src/Generating/StructGen.cpp
diff options
context:
space:
mode:
authorSTRWarrior <niels.breuker@hotmail.nl>2014-08-10 11:40:33 +0200
committerSTRWarrior <niels.breuker@hotmail.nl>2014-08-10 11:40:33 +0200
commitecfae286064b4a8fcf6e4df38c09e8055e83de33 (patch)
tree90ea4db9300a1a735484eee8fb2104d001c168f7 /src/Generating/StructGen.cpp
parentRemoved an old and outdated comment. (diff)
downloadcuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.tar
cuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.tar.gz
cuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.tar.bz2
cuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.tar.lz
cuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.tar.xz
cuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.tar.zst
cuberite-ecfae286064b4a8fcf6e4df38c09e8055e83de33.zip
Diffstat (limited to '')
-rw-r--r--src/Generating/StructGen.cpp58
1 files changed, 10 insertions, 48 deletions
diff --git a/src/Generating/StructGen.cpp b/src/Generating/StructGen.cpp
index f7e609353..1a43f2b2e 100644
--- a/src/Generating/StructGen.cpp
+++ b/src/Generating/StructGen.cpp
@@ -13,45 +13,6 @@
////////////////////////////////////////////////////////////////////////////////
-// cStructGenOreNests configuration:
-
-const int MAX_HEIGHT_COAL = 127;
-const int NUM_NESTS_COAL = 50;
-const int NEST_SIZE_COAL = 10;
-
-const int MAX_HEIGHT_IRON = 64;
-const int NUM_NESTS_IRON = 14;
-const int NEST_SIZE_IRON = 6;
-
-const int MAX_HEIGHT_REDSTONE = 16;
-const int NUM_NESTS_REDSTONE = 4;
-const int NEST_SIZE_REDSTONE = 6;
-
-const int MAX_HEIGHT_GOLD = 32;
-const int NUM_NESTS_GOLD = 2;
-const int NEST_SIZE_GOLD = 6;
-
-const int MAX_HEIGHT_DIAMOND = 15;
-const int NUM_NESTS_DIAMOND = 1;
-const int NEST_SIZE_DIAMOND = 4;
-
-const int MAX_HEIGHT_LAPIS = 30;
-const int NUM_NESTS_LAPIS = 2;
-const int NEST_SIZE_LAPIS = 5;
-
-const int MAX_HEIGHT_DIRT = 127;
-const int NUM_NESTS_DIRT = 20;
-const int NEST_SIZE_DIRT = 32;
-
-const int MAX_HEIGHT_GRAVEL = 70;
-const int NUM_NESTS_GRAVEL = 15;
-const int NEST_SIZE_GRAVEL = 32;
-
-
-
-
-
-////////////////////////////////////////////////////////////////////////////////
// cStructGenTrees:
void cStructGenTrees::GenFinish(cChunkDesc & a_ChunkDesc)
@@ -311,14 +272,15 @@ void cStructGenOreNests::GenFinish(cChunkDesc & a_ChunkDesc)
int ChunkX = a_ChunkDesc.GetChunkX();
int ChunkZ = a_ChunkDesc.GetChunkZ();
cChunkDef::BlockTypes & BlockTypes = a_ChunkDesc.GetBlockTypes();
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_COAL_ORE, MAX_HEIGHT_COAL, NUM_NESTS_COAL, NEST_SIZE_COAL, BlockTypes, 1);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_IRON_ORE, MAX_HEIGHT_IRON, NUM_NESTS_IRON, NEST_SIZE_IRON, BlockTypes, 2);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_REDSTONE_ORE, MAX_HEIGHT_REDSTONE, NUM_NESTS_REDSTONE, NEST_SIZE_REDSTONE, BlockTypes, 3);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_GOLD_ORE, MAX_HEIGHT_GOLD, NUM_NESTS_GOLD, NEST_SIZE_GOLD, BlockTypes, 4);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_DIAMOND_ORE, MAX_HEIGHT_DIAMOND, NUM_NESTS_DIAMOND, NEST_SIZE_DIAMOND, BlockTypes, 5);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_LAPIS_ORE, MAX_HEIGHT_LAPIS, NUM_NESTS_LAPIS, NEST_SIZE_LAPIS, BlockTypes, 6);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_DIRT, MAX_HEIGHT_DIRT, NUM_NESTS_DIRT, NEST_SIZE_DIRT, BlockTypes, 10);
- GenerateOre(ChunkX, ChunkZ, E_BLOCK_GRAVEL, MAX_HEIGHT_GRAVEL, NUM_NESTS_GRAVEL, NEST_SIZE_GRAVEL, BlockTypes, 11);
+
+ int seq = 1;
+
+ // Generate the ores from the ore list.
+ for (OreList::iterator itr = m_OreList.begin(); itr != m_OreList.end(); ++itr)
+ {
+ GenerateOre(ChunkX, ChunkZ, itr->BlockType, itr->MaxHeight, itr->NumNests, itr->NestSize, BlockTypes, seq);
+ seq++;
+ }
}
@@ -376,7 +338,7 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore
}
int Index = cChunkDef::MakeIndexNoCheck(BlockX, BlockY, BlockZ);
- if (a_BlockTypes[Index] == E_BLOCK_STONE)
+ if (a_BlockTypes[Index] == m_ToReplace)
{
a_BlockTypes[Index] = a_OreType;
}