19 #include "../Noise/Noise.h" 20 #include "../ProbabDistrib.h" 21 #include "../Mobs/Monster.h" 65 void TryPlaceClump(
cChunkDesc & a_ChunkDesc,
int a_RelX,
int a_RelY,
int a_RelZ,
BLOCKTYPE a_Block);
85 m_BlockType(a_BlockType),
86 m_BlockMeta(a_BlockMeta),
99 m_MinNumClumpsPerChunk(0),
100 m_MaxNumClumpsPerChunk(2),
104 BiomeInfo(
int a_MinNumClumpsPerChunk,
int a_MaxNumClumpsPerChunk, std::vector<FoliageInfo> a_Blocks) :
105 m_MinNumClumpsPerChunk(a_MinNumClumpsPerChunk),
106 m_MaxNumClumpsPerChunk(a_MaxNumClumpsPerChunk),
116 std::swap(a_BlockList, m_FlowersPerBiome);
121 static void ParseConfigurationString(
AString a_String, std::vector<BiomeInfo> & a_Output);
124 static std::vector<BiomeInfo> ParseIniFile(
cIniFile & a_IniFile,
AString a_ClumpPrefix);
131 const int MAX_NUM_FOLIAGE = 8;
134 const int MIN_NUM_FOLIAGE = 4;
137 const int RANGE_FROM_CENTER = 5;
139 void TryPlaceFoliageClump(
cChunkDesc & a_ChunkDesc,
int a_RelX,
int a_RelZ,
BLOCKTYPE a_BlockType,
NIBBLETYPE a_BlockMeta,
bool a_IsDoubleTall);
161 void TryPlaceGlowstone(
cChunkDesc & a_ChunkDesc,
int a_RelX,
int a_RelY,
int a_RelZ,
int a_Size,
int a_NumStrings);
266 m_MaxCactusHeight(a_MaxCactusHeight),
267 m_MaxSugarcaneHeight(a_MaxSugarcaneHeight)
283 static bool IsDesertVariant(
EMCSBiome a_biome);
302 bool m_IsAllowedBelow[256];
305 bool m_IsBiomeAllowed[256];
309 int a_Seed,
BLOCKTYPE a_BlockType, BiomeList a_Biomes,
int a_Amount,
310 BlockList a_AllowedBelow
313 m_BlockType(a_BlockType),
317 for (
size_t idx = 0; idx <
ARRAYCOUNT(m_IsAllowedBelow); ++idx)
319 m_IsAllowedBelow[idx] =
false;
323 for (BlockList::iterator itr = a_AllowedBelow.begin(); itr != a_AllowedBelow.end(); ++itr)
325 m_IsAllowedBelow[*itr] =
true;
329 for (
size_t idx = 0; idx <
ARRAYCOUNT(m_IsBiomeAllowed); ++idx)
331 m_IsBiomeAllowed[idx] =
false;
335 for (BiomeList::iterator itr = a_Biomes.begin(); itr != a_Biomes.end(); ++itr)
337 m_IsBiomeAllowed[*itr] =
true;
354 return m_IsBiomeAllowed[a_Biome];
360 return m_IsAllowedBelow[a_BlockBelow];
406 void CollapseSandGravel(
cChunkDesc & a_ChunkDesc);
411 void StationarizeFluid(
443 bool TryPlaceSpring(
cChunkDesc & a_ChunkDesc,
int x,
int y,
int z);
511 m_BlockType(a_OreType),
512 m_BlockMeta(a_OreMeta),
513 m_MaxHeight(a_MaxHeight),
514 m_NumNests(a_NumNests),
515 m_NestSize(a_NestSize)
524 m_OreInfos(a_OreInfos)
532 static const OreInfos & DefaultOverworldOres(
void);
535 static const OreInfos & DefaultNetherOres(
void);
538 static const OreInfos & DefaultNaturalPatches(
void);
543 static OreInfos OreInfosFromString(
const AString & a_OreInfosString);
548 static AString OreInfosToString(
const OreInfos & a_OreInfos);
551 void SetSeed(
int a_Seed);
563 virtual void GenerateOre(
566 int a_MaxHeight,
int a_NumNests,
int a_NestSize,
584 Super(a_Seed, a_OreInfos)
590 virtual void GenerateOre(
593 int a_MaxHeight,
int a_NumNests,
int a_NestSize,
609 Super(a_Seed, a_OreInfos)
620 virtual void GenerateOre(
623 int a_MaxNestHeight,
int a_NumNests,
int a_NestSize,
629 void imprintChunkOrePockets(
630 int a_ChunkX,
int a_ChunkZ,
633 int a_MaxHeight,
int a_NumNests,
int a_NestSize,
642 int a_MinPocketX,
int a_PocketY,
int a_MinPocketZ,
643 int a_NestSize,
int a_Seq,
650 double a_SphereX,
double a_SphereY,
double a_SphereZ,
double a_Radius,
FoliageInfo(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_Weight)
eDimension
Dimension of a world.
cFinishGenSingleTopBlock(int a_Seed, BLOCKTYPE a_BlockType, BiomeList a_Biomes, int a_Amount, BlockList a_AllowedBelow)
BLOCKTYPE BlockTypes[NumBlocks]
The type used for block type operations and storage, AXIS_ORDER ordering.
unsigned char BLOCKTYPE
The datatype used by blockdata.
std::vector< OreInfo > OreInfos
cFinishGenVines(int a_Seed, int a_Level)
bool IsAllowedBlockBelow(BLOCKTYPE a_BlockBelow)
Returns true if the given blocktype may be below m_BlockType.
std::vector< BiomeInfo > m_FlowersPerBiome
BiomeInfo(int a_MinNumClumpsPerChunk, int a_MaxNumClumpsPerChunk, std::vector< FoliageInfo > a_Blocks)
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
bool m_PreSimulateFallingBlocks
Base class for generators that have an ore list attached to them.
unsigned char HEIGHTTYPE
The type used by the heightmap.
cProbabDistrib m_HeightDistribution
cNoise m_Noise
The noise used for generating.
eMonsterType
Identifies individual monster type, as well as their network type-ID.
int m_MinNumClumpsPerChunk
OreInfo(BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize)
This class adds a single top block in random positions in the specified biome on top of specified all...
cFinishGenClumpTopBlock(int a_Seed, std::vector< BiomeInfo > a_BlockList)
cFinishGenBottomLava(int a_Level)
cNoise m_Noise
The noise used as the source of randomness.
int m_Amount
Relative amount of blocks to try adding.
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
int m_MaxNumClumpsPerChunk
int m_Chance
Chance, [0..100], that a spring will be generated in a chunk.
int GetBiomeDensity(EMCSBiome a_Biome)
cFinishGenOrePockets(int a_Seed, const OreInfos &a_OreInfos)
std::vector< BLOCKTYPE > BlockList
OreInfos m_OreInfos
All the ores enabled in this generator.
std::vector< EMCSBiome > BiomeList
cFinishGenNetherClumpFoliage(int a_Seed)
std::vector< FoliageInfo > m_Blocks
cFinishGenTallGrass(int a_Seed)
cFinishGenOres(int a_Seed, const OreInfos &a_OreInfos)
cFinishGenSoulsandRims(int a_Seed)
bool IsAllowedBiome(EMCSBiome a_Biome)
Returns true if the given biome is a biome that is allowed.
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...
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
cFinishGenSprinkleFoliage(int a_Seed, int a_MaxCactusHeight, int a_MaxSugarcaneHeight)
int m_AnimalProbability
Chance, [0..100], that an animal pack will be generated in a chunk.
cFinishGenOreNests(int a_Seed, const OreInfos &a_OreInfos)
This class populates generated chunks with packs of biome-dependant animals Animals: cows...
cFinishGenGlowStone(int a_Seed)