Skip to content

Commit

Permalink
Made the minimum vine level configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
NiLSPACE committed Feb 28, 2015
1 parent 19d7ec5 commit 0394acf
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion src/Generating/ComposableGenerator.cpp
Expand Up @@ -618,7 +618,8 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
}
else if (NoCaseCompare(*itr, "Vines") == 0)
{
m_FinishGens.push_back(cFinishGenPtr(new cFinishGenVines(Seed)));
int Level = a_IniFile.GetValueSetI("Generator", "VinesLevel", 40);
m_FinishGens.push_back(cFinishGenPtr(new cFinishGenVines(Seed, Level)));
}
else if (NoCaseCompare(*itr, "WaterLakes") == 0)
{
Expand Down
2 changes: 1 addition & 1 deletion src/Generating/FinishGen.cpp
Expand Up @@ -287,7 +287,7 @@ void cFinishGenVines::GenFinish(cChunkDesc & a_ChunkDesc)
}

int Height = a_ChunkDesc.GetHeight(x, z);
for (int y = Height; y > 40; y--)
for (int y = Height; y > m_Level; y--)
{
if (a_ChunkDesc.GetBlockType(x, y, z) != E_BLOCK_AIR)
{
Expand Down
6 changes: 4 additions & 2 deletions src/Generating/FinishGen.h
Expand Up @@ -122,15 +122,17 @@ class cFinishGenVines :
public cFinishGen
{
public:
cFinishGenVines(int a_Seed) :
m_Noise(a_Seed)
cFinishGenVines(int a_Seed, int a_Level) :
m_Noise(a_Seed),
m_Level(a_Level)
{
}

bool IsJungleVariant(EMCSBiome a_Biome);

protected:
cNoise m_Noise;
int m_Level;

virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
};
Expand Down

0 comments on commit 0394acf

Please sign in to comment.