Added Granite, Diorite and Andesite to the NaturalPatches generator.
This commit is contained in:
parent
439f07cab5
commit
76e0c592ef
@ -428,6 +428,33 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
|
|||||||
GravelVein.NestSize = 32;
|
GravelVein.NestSize = 32;
|
||||||
Ores.push_back(GravelVein);
|
Ores.push_back(GravelVein);
|
||||||
|
|
||||||
|
// Granite vein
|
||||||
|
cStructGenOreNests::OreInfo GraniteVein;
|
||||||
|
GraniteVein.BlockType = E_BLOCK_STONE;
|
||||||
|
GraniteVein.BlockMeta = 1;
|
||||||
|
GraniteVein.MaxHeight = 127;
|
||||||
|
GraniteVein.NumNests = 20;
|
||||||
|
GraniteVein.NestSize = 32;
|
||||||
|
Ores.push_back(GraniteVein);
|
||||||
|
|
||||||
|
// Diorite vein
|
||||||
|
cStructGenOreNests::OreInfo DioriteVein;
|
||||||
|
DioriteVein.BlockType = E_BLOCK_STONE;
|
||||||
|
DioriteVein.BlockMeta = 3;
|
||||||
|
DioriteVein.MaxHeight = 127;
|
||||||
|
DioriteVein.NumNests = 20;
|
||||||
|
DioriteVein.NestSize = 32;
|
||||||
|
Ores.push_back(DioriteVein);
|
||||||
|
|
||||||
|
// Andesite vein
|
||||||
|
cStructGenOreNests::OreInfo AndesiteVein;
|
||||||
|
AndesiteVein.BlockType = E_BLOCK_STONE;
|
||||||
|
AndesiteVein.BlockMeta = 5;
|
||||||
|
AndesiteVein.MaxHeight = 127;
|
||||||
|
AndesiteVein.NumNests = 20;
|
||||||
|
AndesiteVein.NestSize = 32;
|
||||||
|
Ores.push_back(AndesiteVein);
|
||||||
|
|
||||||
m_FinishGens.push_back(new cStructGenOreNests(Seed, Ores, E_BLOCK_STONE));
|
m_FinishGens.push_back(new cStructGenOreNests(Seed, Ores, E_BLOCK_STONE));
|
||||||
}
|
}
|
||||||
else if (NoCaseCompare(*itr, "NetherClumpFoliage") == 0)
|
else if (NoCaseCompare(*itr, "NetherClumpFoliage") == 0)
|
||||||
|
@ -272,13 +272,14 @@ void cStructGenOreNests::GenFinish(cChunkDesc & a_ChunkDesc)
|
|||||||
int ChunkX = a_ChunkDesc.GetChunkX();
|
int ChunkX = a_ChunkDesc.GetChunkX();
|
||||||
int ChunkZ = a_ChunkDesc.GetChunkZ();
|
int ChunkZ = a_ChunkDesc.GetChunkZ();
|
||||||
cChunkDef::BlockTypes & BlockTypes = a_ChunkDesc.GetBlockTypes();
|
cChunkDef::BlockTypes & BlockTypes = a_ChunkDesc.GetBlockTypes();
|
||||||
|
cChunkDesc::BlockNibbleBytes & BlockMetas = a_ChunkDesc.GetBlockMetasUncompressed();
|
||||||
|
|
||||||
int seq = 1;
|
int seq = 1;
|
||||||
|
|
||||||
// Generate the ores from the ore list.
|
// Generate the ores from the ore list.
|
||||||
for (OreList::const_iterator itr = m_OreList.begin(); itr != m_OreList.end(); ++itr)
|
for (OreList::const_iterator itr = m_OreList.begin(); itr != m_OreList.end(); ++itr)
|
||||||
{
|
{
|
||||||
GenerateOre(ChunkX, ChunkZ, itr->BlockType, itr->MaxHeight, itr->NumNests, itr->NestSize, BlockTypes, seq);
|
GenerateOre(ChunkX, ChunkZ, itr->BlockType, itr->BlockMeta, itr->MaxHeight, itr->NumNests, itr->NestSize, BlockTypes, BlockMetas, seq);
|
||||||
seq++;
|
seq++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -287,7 +288,7 @@ void cStructGenOreNests::GenFinish(cChunkDesc & a_ChunkDesc)
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_OreType, int a_MaxHeight, int a_NumNests, int a_NestSize, cChunkDef::BlockTypes & a_BlockTypes, int a_Seq)
|
void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_OreType, NIBBLETYPE a_BlockMeta, int a_MaxHeight, int a_NumNests, int a_NestSize, cChunkDef::BlockTypes & a_BlockTypes, cChunkDesc::BlockNibbleBytes & a_BlockMetas, int a_Seq)
|
||||||
{
|
{
|
||||||
// This function generates several "nests" of ore, each nest consisting of number of ore blocks relatively adjacent to each other.
|
// This function generates several "nests" of ore, each nest consisting of number of ore blocks relatively adjacent to each other.
|
||||||
// It does so by making a random XYZ walk and adding ore along the way in cuboids of different (random) sizes
|
// It does so by making a random XYZ walk and adding ore along the way in cuboids of different (random) sizes
|
||||||
@ -341,6 +342,7 @@ void cStructGenOreNests::GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_Ore
|
|||||||
if (a_BlockTypes[Index] == m_ToReplace)
|
if (a_BlockTypes[Index] == m_ToReplace)
|
||||||
{
|
{
|
||||||
a_BlockTypes[Index] = a_OreType;
|
a_BlockTypes[Index] = a_OreType;
|
||||||
|
a_BlockMetas[Index] = a_BlockMeta;
|
||||||
}
|
}
|
||||||
Num++;
|
Num++;
|
||||||
} // for z
|
} // for z
|
||||||
|
@ -79,6 +79,7 @@ public:
|
|||||||
struct OreInfo
|
struct OreInfo
|
||||||
{
|
{
|
||||||
BLOCKTYPE BlockType; // The type of the nest.
|
BLOCKTYPE BlockType; // The type of the nest.
|
||||||
|
NIBBLETYPE BlockMeta = 0; // The block meta
|
||||||
int MaxHeight; // The highest possible a nest can occur
|
int MaxHeight; // The highest possible a nest can occur
|
||||||
int NumNests; // How many nests per chunk
|
int NumNests; // How many nests per chunk
|
||||||
int NestSize; // The amount of blocks a nest can have.
|
int NestSize; // The amount of blocks a nest can have.
|
||||||
@ -103,7 +104,7 @@ protected:
|
|||||||
// cFinishGen override:
|
// cFinishGen override:
|
||||||
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
|
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
|
||||||
|
|
||||||
void GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_OreType, int a_MaxHeight, int a_NumNests, int a_NestSize, cChunkDef::BlockTypes & a_BlockTypes, int a_Seq);
|
void GenerateOre(int a_ChunkX, int a_ChunkZ, BLOCKTYPE a_OreType, NIBBLETYPE a_BlockMeta, int a_MaxHeight, int a_NumNests, int a_NestSize, cChunkDef::BlockTypes & a_BlockTypes, cChunkDesc::BlockNibbleBytes & a_BlockMetas, int a_Seq);
|
||||||
} ;
|
} ;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user