parent
36500f88b2
commit
fa4a85c915
|
@ -290,17 +290,7 @@ void cCompoGenNether::ComposeTerrain(cChunkDesc & a_ChunkDesc, const cChunkDesc:
|
|||
BLOCKTYPE Block = E_BLOCK_AIR;
|
||||
if (Val < m_Threshold) // Don't calculate if the block should be Netherrack or Soulsand when it's already decided that it's air.
|
||||
{
|
||||
NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(BaseX + x)) / 8;
|
||||
NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(BaseZ + z)) / 8;
|
||||
NOISE_DATATYPE CompBlock = m_Noise1.CubicNoise3D(NoiseX, (float) (y + Segment) / 2, NoiseY);
|
||||
if (CompBlock < -0.5)
|
||||
{
|
||||
Block = E_BLOCK_SOULSAND;
|
||||
}
|
||||
else
|
||||
{
|
||||
Block = E_BLOCK_NETHERRACK;
|
||||
}
|
||||
Block = E_BLOCK_NETHERRACK;
|
||||
}
|
||||
a_ChunkDesc.SetBlockType(x, y + Segment, z, Block);
|
||||
}
|
||||
|
|
|
@ -570,6 +570,10 @@ void cComposableGenerator::InitFinishGens(cIniFile & a_IniFile)
|
|||
GridSize, MaxOffset
|
||||
)));
|
||||
}
|
||||
else if (NoCaseCompare(*itr, "SoulsandRims") == 0)
|
||||
{
|
||||
m_FinishGens.push_back(cFinishGenPtr(new cFinishGenSoulsandRims(Seed)));
|
||||
}
|
||||
else if (NoCaseCompare(*itr, "Snow") == 0)
|
||||
{
|
||||
m_FinishGens.push_back(cFinishGenPtr(new cFinishGenSnow));
|
||||
|
|
|
@ -391,6 +391,88 @@ void cFinishGenSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc)
|
|||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cFinishGenSoulsandRims
|
||||
|
||||
void cFinishGenSoulsandRims::GenFinish(cChunkDesc & a_ChunkDesc)
|
||||
{
|
||||
int ChunkX = a_ChunkDesc.GetChunkX() * cChunkDef::Width;
|
||||
int ChunkZ = a_ChunkDesc.GetChunkZ() * cChunkDef::Width;
|
||||
HEIGHTTYPE MaxHeight = a_ChunkDesc.GetMaxHeight();
|
||||
|
||||
for (int x = 0; x < 16; x++)
|
||||
{
|
||||
int xx = ChunkX + x;
|
||||
for (int z = 0; z < 16; z++)
|
||||
{
|
||||
int zz = ChunkZ + z;
|
||||
|
||||
// Place soulsand rims when netherrack gets thin
|
||||
for (int y = 2; y < MaxHeight - 2; y++)
|
||||
{
|
||||
// The current block is air. Let's bail ut.
|
||||
BLOCKTYPE Block = a_ChunkDesc.GetBlockType(x, y, z);
|
||||
if (Block == E_BLOCK_AIR)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check how many blocks there are above the current block. Don't go higher than 2 blocks, because we already bail out if that's the case.
|
||||
int NumBlocksAbove = 0;
|
||||
for (int I = y + 1; I <= y + 2; I++)
|
||||
{
|
||||
if (a_ChunkDesc.GetBlockType(x, I, z) != E_BLOCK_AIR)
|
||||
{
|
||||
NumBlocksAbove++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// There are too many blocks above the current block.
|
||||
if (NumBlocksAbove == 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Check how many blocks there below the current block. Don't go lower than 2 blocks, because we already bail out if that's the case.
|
||||
int NumBlocksBelow = 0;
|
||||
for (int I = y - 1; I >= y - 2; I--)
|
||||
{
|
||||
if (a_ChunkDesc.GetBlockType(x, I, z) != E_BLOCK_AIR)
|
||||
{
|
||||
NumBlocksBelow++;
|
||||
}
|
||||
else
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// There are too many blocks below the current block
|
||||
if (NumBlocksBelow == 2)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
NOISE_DATATYPE NoiseX = ((NOISE_DATATYPE)(xx)) / 32;
|
||||
NOISE_DATATYPE NoiseY = ((NOISE_DATATYPE)(zz)) / 32;
|
||||
NOISE_DATATYPE CompBlock = m_Noise.CubicNoise3D(NoiseX, (float) (y) / 4, NoiseY);
|
||||
if (CompBlock < 0)
|
||||
{
|
||||
a_ChunkDesc.SetBlockType(x, y, z, E_BLOCK_SOULSAND);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// cFinishGenSnow:
|
||||
|
||||
|
|
|
@ -117,6 +117,25 @@ protected:
|
|||
|
||||
|
||||
|
||||
class cFinishGenSoulsandRims :
|
||||
public cFinishGen
|
||||
{
|
||||
public:
|
||||
cFinishGenSoulsandRims(int a_Seed) :
|
||||
m_Noise(a_Seed)
|
||||
{
|
||||
}
|
||||
|
||||
protected:
|
||||
cNoise m_Noise;
|
||||
|
||||
virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
|
||||
} ;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class cFinishGenSprinkleFoliage :
|
||||
public cFinishGen
|
||||
{
|
||||
|
|
|
@ -759,7 +759,7 @@ void cWorld::InitialiseGeneratorDefaults(cIniFile & a_IniFile)
|
|||
a_IniFile.GetValueSet("Generator", "HeightGen", "Flat");
|
||||
a_IniFile.GetValueSet("Generator", "FlatHeight", "128");
|
||||
a_IniFile.GetValueSet("Generator", "CompositionGen", "Nether");
|
||||
a_IniFile.GetValueSet("Generator", "Finishers", "WormNestCaves, BottomLava, LavaSprings, NetherClumpFoliage, NetherForts, PreSimulator");
|
||||
a_IniFile.GetValueSet("Generator", "Finishers", "SoulsandRims, WormNestCaves, BottomLava, LavaSprings, NetherClumpFoliage, NetherForts, PreSimulator");
|
||||
a_IniFile.GetValueSet("Generator", "BottomLavaHeight", "30");
|
||||
break;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue