diff options
author | STRWarrior <niels.breuker@hotmail.nl> | 2014-01-18 13:45:41 +0100 |
---|---|---|
committer | STRWarrior <niels.breuker@hotmail.nl> | 2014-01-18 13:45:41 +0100 |
commit | dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5 (patch) | |
tree | 8a3bf6b1f6af86703161e0ba754df1bcfefe7d19 /src/Generating/FinishGen.cpp | |
parent | Fixed bug where only brown mushrooms would spawn. (diff) | |
download | cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.tar cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.tar.gz cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.tar.bz2 cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.tar.lz cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.tar.xz cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.tar.zst cuberite-dd7c02bba9b963afa572ba3e3b9abe50aa8cf4d5.zip |
Diffstat (limited to 'src/Generating/FinishGen.cpp')
-rw-r--r-- | src/Generating/FinishGen.cpp | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/Generating/FinishGen.cpp b/src/Generating/FinishGen.cpp index 0b5205c5c..5726c5806 100644 --- a/src/Generating/FinishGen.cpp +++ b/src/Generating/FinishGen.cpp @@ -13,6 +13,7 @@ #include "../Noise.h" #include "../BlockID.h" #include "../Simulator/FluidSimulator.h" // for cFluidSimulator::CanWashAway() +#include "../Simulator/FireSimulator.h" #include "../World.h" @@ -93,15 +94,15 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc) } NOISE_DATATYPE BlockType = m_Noise.CubicNoise1D((float) (ChunkX * ChunkZ) / (y * 0.1f)); - if (BlockType < -0.30) + if (BlockType < -0.7) { TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_BROWN_MUSHROOM); } - else if (BlockType < -0.20) + else if (BlockType < 0) { TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_RED_MUSHROOM); } - else if (BlockType < -0.10) + else if (BlockType < 0.7) { TryPlaceClumb(a_ChunkDesc, PosX, y, PosZ, E_BLOCK_FIRE); } @@ -114,7 +115,8 @@ void cFinishGenNetherSprinkleFoliage::GenFinish(cChunkDesc & a_ChunkDesc) void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block) { - a_ChunkDesc.SetBlockType(a_RelX, a_RelY, a_RelZ, a_Block); + bool IsFireBlock = a_Block == E_BLOCK_FIRE; + for (int x = a_RelX - 4; x < a_RelX + 4; x++) { float xx = (float) a_ChunkDesc.GetChunkX() * cChunkDef::Width + x; @@ -127,11 +129,22 @@ void cFinishGenNetherSprinkleFoliage::TryPlaceClumb(cChunkDesc & a_ChunkDesc, in { continue; } - if (!g_BlockIsSolid[a_ChunkDesc.GetBlockType(x, y - 1, z)]) // Only place on solid blocks + + BLOCKTYPE BlockBelow = a_ChunkDesc.GetBlockType(x, y - 1, z); + if (!g_BlockIsSolid[BlockBelow]) // Only place on solid blocks { continue; } + if (IsFireBlock) // don't place fire on non-forever burning blocks. + { + if (!cFireSimulator::DoesBurnForever(BlockBelow)) + { + continue; + } + } + + NOISE_DATATYPE Val = m_Noise.CubicNoise2D(xx, zz); if (Val < -0.70) { |