21 #include "../Noise/Noise.h"
22 #include "../ProbabDistrib.h"
23 #include "../Mobs/Monster.h"
106 BiomeInfo(
int a_MinNumClumpsPerChunk,
int a_MaxNumClumpsPerChunk, std::vector<FoliageInfo> a_Blocks) :
300 for (BlockList::iterator itr = a_AllowedBelow.begin(); itr != a_AllowedBelow.end(); ++itr)
312 for (BiomeList::iterator itr = a_Biomes.begin(); itr != a_Biomes.end(); ++itr)
544 int a_MaxHeight,
int a_NumNests,
int a_NestSize,
563 Super(a_Seed, a_OreInfos)
572 int a_MaxHeight,
int a_NumNests,
int a_NestSize,
589 Super(a_Seed, a_OreInfos)
602 int a_MaxNestHeight,
int a_NumNests,
int a_NestSize,
609 int a_ChunkX,
int a_ChunkZ,
612 int a_MaxHeight,
int a_NumNests,
int a_NestSize,
621 int a_MinPocketX,
int a_PocketY,
int a_MinPocketZ,
622 int a_NestSize,
int a_Seq,
629 double a_SphereX,
double a_SphereY,
double a_SphereZ,
double a_Radius,
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
unsigned char HEIGHTTYPE
The type used by the heightmap.
unsigned char BLOCKTYPE
The datatype used by blockdata.
eDimension
Dimension of a world.
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
eMonsterType
Identifies individual monster type.
BLOCKTYPE BlockTypes[NumBlocks]
The type used for block type operations and storage, AXIS_ORDER ordering.
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
The interface that a finisher must implement Finisher implements changes to the chunk after the rough...
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
cFinishGenNetherClumpFoliage(int a_Seed)
void TryPlaceClump(cChunkDesc &a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
static std::vector< BiomeInfo > ParseIniFile(cIniFile &a_IniFile, const AString &a_ClumpPrefix)
Parses an inifile in search for all clumps.
cFinishGenClumpTopBlock(int a_Seed, std::vector< BiomeInfo > a_BlockList)
const int MIN_NUM_FOLIAGE
The minimum number of foliage per clump.
const int MAX_NUM_FOLIAGE
The maximum number of foliage per clump.
std::vector< BiomeInfo > m_FlowersPerBiome
void TryPlaceFoliageClump(cChunkDesc &a_ChunkDesc, int a_RelX, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, bool a_IsDoubleTall)
const int RANGE_FROM_CENTER
The maximum range a foliage can be placed from the center of the clump.
static void ParseConfigurationString(const AString &a_String, std::vector< BiomeInfo > &a_Output)
Parses a string and puts a vector with a length of biMaxVariantBiome in a_Output.
FoliageInfo(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_Weight)
std::vector< FoliageInfo > m_Blocks
int m_MinNumClumpsPerChunk
BiomeInfo(int a_MinNumClumpsPerChunk, int a_MaxNumClumpsPerChunk, std::vector< FoliageInfo > a_Blocks)
int m_MaxNumClumpsPerChunk
void TryPlaceGlowstone(cChunkDesc &a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, int a_Size, int a_NumStrings)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
cFinishGenGlowStone(int a_Seed)
cFinishGenTallGrass(int a_Seed)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
static bool CanFernGrow(EMCSBiome a_Biome)
static bool CanGrassGrow(EMCSBiome a_Biome)
static int GetBiomeDensity(EMCSBiome a_Biome)
static bool CanLargeFernGrow(EMCSBiome a_Biome)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
cFinishGenVines(int a_Seed, int a_Level)
bool IsJungleVariant(EMCSBiome a_Biome)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
cFinishGenSoulsandRims(int a_Seed)
bool TryAddSugarcane(cChunkDesc &a_ChunkDesc, int a_RelX, HEIGHTTYPE &a_RelY, int a_RelZ)
Tries to place sugarcane at the coords specified, returns true if successful, updates the top variabl...
static bool IsDesertVariant(EMCSBiome a_biome)
cFinishGenSprinkleFoliage(int a_Seed, int a_MaxCactusHeight, int a_MaxSugarcaneHeight)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
bool TryAddCactus(cChunkDesc &a_ChunkDesc, int a_RelX, HEIGHTTYPE &a_RelY, int a_RelZ)
Tries to place cactus at the coords specified, returns true if successful, updates the top variable (...
This class adds a single top block in random positions in the specified biome on top of specified all...
std::vector< EMCSBiome > BiomeList
bool m_IsBiomeAllowed[256]
cFinishGenSingleTopBlock(int a_Seed, BLOCKTYPE a_BlockType, BiomeList a_Biomes, int a_Amount, BlockList a_AllowedBelow)
bool m_IsAllowedBelow[256]
int m_Amount
Relative amount of blocks to try adding.
std::vector< BLOCKTYPE > BlockList
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
bool IsAllowedBlockBelow(BLOCKTYPE a_BlockBelow)
Returns true if the given blocktype may be below m_BlockType.
bool IsAllowedBiome(EMCSBiome a_Biome)
Returns true if the given biome is a biome that is allowed.
int GetNumToGen(const cChunkDef::BiomeMap &a_BiomeMap)
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
cFinishGenBottomLava(int a_Level)
cFinishGenPreSimulator(bool a_PreSimulateFallingBlocks, bool a_PreSimulateWater, bool a_PreSimulateLava)
void CollapseSandGravel(cChunkDesc &a_ChunkDesc)
Drops hanging sand and gravel down to the ground, recalculates heightmap.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
void StationarizeFluid(cChunkDef::BlockTypes &a_BlockTypes, cChunkDef::HeightMap &a_HeightMap, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid)
For each fluid block:
bool m_PreSimulateFallingBlocks
bool TryPlaceSpring(cChunkDesc &a_ChunkDesc, int x, int y, int z)
Tries to place a spring at the specified coords, checks neighbors.
cProbabDistrib m_HeightDistribution
cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cIniFile &a_IniFile, eDimension a_Dimension)
int m_Chance
Chance, [0..100], that a spring will be generated in a chunk.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
This class populates generated chunks with packs of biome-dependant animals Animals: cows,...
bool TrySpawnAnimals(cChunkDesc &a_ChunkDesc, int x, int y, int z, eMonsterType AnimalToSpawn)
Returns false if an animal cannot spawn at given coords, else adds it to the chunk's entity list and ...
int m_AnimalProbability
Chance, [0..100], that an animal pack will be generated in a chunk.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
eMonsterType GetRandomMob(cChunkDesc &a_ChunkDesc)
Picks a random animal from biome-dependant list for a random position in the chunk.
cFinishGenPassiveMobs(int a_Seed, cIniFile &a_IniFile, eDimension a_Dimension)
cNoise m_Noise
The noise used as the source of randomness.
Base class for generators that have an ore list attached to them.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
static const OreInfos & DefaultOverworldOres(void)
Returns a vector of OreInfo structures describing the default Overworld ores, usable in the construct...
static OreInfos OreInfosFromString(const AString &a_OreInfosString)
Parses the parameter string into OreInfos array.
OreInfos m_OreInfos
All the ores enabled in this generator.
static const OreInfos & DefaultNetherOres(void)
Returns a vector of OreInfo structures describing the default Nether ores, usable in the constructor.
cNoise m_Noise
The noise used for generating.
static AString OreInfosToString(const OreInfos &a_OreInfos)
Returns a string that represents the OreInfos given as the parameter.
static const OreInfos & DefaultNaturalPatches(void)
Returns a vector of OreInfo structures describing the default Overworld non-ore pockets (dirt,...
std::vector< OreInfo > OreInfos
virtual void GenerateOre(cChunkDesc &a_ChunkDesc, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize, int a_Seq)=0
Generates a single ore in the specified chunk image.
cFinishGenOres(int a_Seed, const OreInfos &a_OreInfos)
void SetSeed(int a_Seed)
(Re-)sets the seed used by the internal generating mechanisms.
OreInfo(BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize)
virtual void GenerateOre(cChunkDesc &a_ChunkDesc, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize, int a_Seq) override
Generates a single ore in the specified chunk image.
cFinishGenOreNests(int a_Seed, const OreInfos &a_OreInfos)
virtual void GenerateOre(cChunkDesc &a_ChunkDesc, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxNestHeight, int a_NumNests, int a_NestSize, int a_Seq) override
Generates a single ore in the specified chunk image.
void imprintChunkOrePockets(int a_ChunkX, int a_ChunkZ, cChunkDesc &a_ChunkDesc, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize, int a_Seq)
Calculates the pockets for the specified chunk and imprints them into the specified ChunkDesc (not ne...
void imprintPocket(cChunkDesc &a_ChunkDesc, int a_MinPocketX, int a_PocketY, int a_MinPocketZ, int a_NestSize, int a_Seq, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta)
Imprints a single pocket of the specified ore at the specified coords into the chunk.
cFinishGenOrePockets(int a_Seed, const OreInfos &a_OreInfos)
void imprintSphere(cChunkDesc &a_ChunkDesc, double a_SphereX, double a_SphereY, double a_SphereZ, double a_Radius, BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta)
Imprints a single sphere of the specified ore at the specified coords.
void Initialize(cIniFile &a_IniFile, const AString &a_GenName)
Reads the configuration from the specified INI file.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
cFinishGenForestRocks(int a_Seed, cIniFile &a_IniFile)