diff options
author | Mattes D <github@xoft.cz> | 2014-12-05 22:19:44 +0100 |
---|---|---|
committer | Mattes D <github@xoft.cz> | 2014-12-05 22:19:44 +0100 |
commit | 5712fadf3101ff6e36479f7a3242cb0f7ee2e069 (patch) | |
tree | 0b27506ae222a3cf1dfe9b54d16f6edb672de199 /src/Generating/FinishGen.h | |
parent | CheckBasicStyle: Check missing braces for control statements. (diff) | |
parent | formatting and default spawn percentage (diff) | |
download | cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.tar cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.tar.gz cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.tar.bz2 cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.tar.lz cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.tar.xz cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.tar.zst cuberite-5712fadf3101ff6e36479f7a3242cb0f7ee2e069.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Generating/FinishGen.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/Generating/FinishGen.h b/src/Generating/FinishGen.h index f568d18bb..8305908c0 100644 --- a/src/Generating/FinishGen.h +++ b/src/Generating/FinishGen.h @@ -18,6 +18,7 @@ #include "ComposableGenerator.h" #include "../Noise/Noise.h" #include "../ProbabDistrib.h" +#include "../Mobs/Monster.h" @@ -311,10 +312,39 @@ protected: // cFinishGen override: virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; - /// Tries to place a spring at the specified coords, checks neighbors. Returns true if successful + // Tries to place a spring at the specified coords, checks neighbors. Returns true if successful bool TryPlaceSpring(cChunkDesc & a_ChunkDesc, int x, int y, int z); } ; + +/** This class populates generated chunks with packs of biome-dependant animals + Animals: cows, sheep, pigs, mooshrooms, squid, horses, wolves, ocelots + */ +class cFinishGenPassiveMobs : + public cFinishGen +{ +public: + + cFinishGenPassiveMobs(int a_Seed, cIniFile & a_IniFile, eDimension a_Dimension); + +protected: + + cNoise m_Noise; + int m_AnimalProbability; // Chance, [0..100], that an animal pack will be generated in a chunk + + // cFinishGen override: + virtual void GenFinish(cChunkDesc & a_ChunkDesc) override; + + // Returns false if an animal cannot spawn at given coords, else adds it to the chunk's entity list and returns true + bool TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int x, int y, int z, eMonsterType AnimalToSpawn); + + // Gets a random animal from biome-dependant list + eMonsterType GetRandomMob(cChunkDesc & a_ChunkDesc); +} ; + + + + |