Cuberite
A lightweight, fast and extensible game server for Minecraft
FinishGen.h
Go to the documentation of this file.
1 
2 // FinishGen.h
3 
4 /* Interfaces to the various finishing generators:
5  - cFinishGenSnow
6  - cFinishGenIce
7  - cFinishGenSprinkleFoliage
8  - cFinishGenLilypads
9  - cFinishGenBottomLava
10  - cFinishGenPreSimulator
11  - cFinishGenDeadBushes
12 */
13 
14 
15 
16 
17 
18 #pragma once
19 
20 #include "ComposableGenerator.h"
21 #include "../Noise/Noise.h"
22 #include "../ProbabDistrib.h"
23 #include "../Mobs/Monster.h"
24 
25 
26 
27 
28 
30  public cFinishGen
31 {
32 protected:
33  // cFinishGen override:
34  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
35 } ;
36 
37 
38 
39 
40 
42  public cFinishGen
43 {
44 protected:
45  // cFinishGen override:
46  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
47 } ;
48 
49 
50 
51 
52 
54  public cFinishGen
55 {
56 public:
58  m_Noise(a_Seed),
59  m_Seed(a_Seed)
60  {
61  }
62 
63 protected:
65  int m_Seed;
66 
67  void TryPlaceClump(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block);
68  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
69 } ;
70 
71 
72 
73 
74 
76  public cFinishGen
77 {
78 public:
79  // Contains the meta, type and weight for a clump block
80  struct FoliageInfo
81  {
84  int m_Weight;
85 
86  FoliageInfo(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_Weight) :
87  m_BlockType(a_BlockType),
88  m_BlockMeta(a_BlockMeta),
89  m_Weight(a_Weight)
90  {}
91  };
92 
93  // Contains the minimum and maximum amount of clumps for a biome and it's blocks.
94  struct BiomeInfo
95  {
98  std::vector<FoliageInfo> m_Blocks;
99 
103  m_Blocks()
104  {}
105 
106  BiomeInfo(int a_MinNumClumpsPerChunk, int a_MaxNumClumpsPerChunk, std::vector<FoliageInfo> a_Blocks) :
107  m_MinNumClumpsPerChunk(a_MinNumClumpsPerChunk),
108  m_MaxNumClumpsPerChunk(a_MaxNumClumpsPerChunk),
109  m_Blocks(std::move(a_Blocks))
110  {}
111  };
112 
113 
114  cFinishGenClumpTopBlock(int a_Seed, std::vector<BiomeInfo> a_BlockList) :
115  m_Noise(a_Seed),
117  {
118  std::swap(a_BlockList, m_FlowersPerBiome);
119  }
120 
123  static void ParseConfigurationString(const AString & a_String, std::vector<BiomeInfo> & a_Output);
124 
126  static std::vector<BiomeInfo> ParseIniFile(cIniFile & a_IniFile, const AString & a_ClumpPrefix);
127 protected:
128 
130  std::vector<BiomeInfo> m_FlowersPerBiome;
131 
133  const int MAX_NUM_FOLIAGE = 8;
134 
136  const int MIN_NUM_FOLIAGE = 4;
137 
139  const int RANGE_FROM_CENTER = 5;
140 
141  void TryPlaceFoliageClump(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, bool a_IsDoubleTall);
142  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
143 };
144 
145 
146 
147 
148 
150  public cFinishGen
151 {
152 public:
153  cFinishGenGlowStone(int a_Seed) :
154  m_Noise(a_Seed),
155  m_Seed(a_Seed)
156  {
157  }
158 
159 protected:
161  int m_Seed;
162 
163  void TryPlaceGlowstone(cChunkDesc & a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, int a_Size, int a_NumStrings);
164  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
165 } ;
166 
167 
168 
169 
170 
172  public cFinishGen
173 {
174 public:
175  cFinishGenTallGrass(int a_Seed) : m_Noise(a_Seed), m_Seed(a_Seed) {}
176 
177 protected:
179  int m_Seed;
180 
181  // cFinishGen override:
182  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
183 
184  static bool CanFernGrow(EMCSBiome a_Biome);
185  static bool CanLargeFernGrow(EMCSBiome a_Biome);
186  static int GetBiomeDensity(EMCSBiome a_Biome);
187  static bool CanGrassGrow(EMCSBiome a_Biome);
188 };
189 
190 
191 
192 
193 
195  public cFinishGen
196 {
197 public:
198  cFinishGenVines(int a_Seed, int a_Level) :
199  m_Noise(a_Seed),
200  m_Level(a_Level)
201  {
202  }
203 
204  bool IsJungleVariant(EMCSBiome a_Biome);
205 
206 protected:
208  int m_Level;
209 
210  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
211 };
212 
213 
214 
215 
216 
218  public cFinishGen
219 {
220 public:
222  m_Noise(a_Seed)
223  {
224  }
225 
226 protected:
228 
229  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
230 } ;
231 
232 
233 
234 
235 
237  public cFinishGen
238 {
239 public:
240  cFinishGenSprinkleFoliage(int a_Seed, int a_MaxCactusHeight, int a_MaxSugarcaneHeight):
241  m_Noise(a_Seed),
242  m_Seed(a_Seed),
243  m_MaxCactusHeight(a_MaxCactusHeight),
244  m_MaxSugarcaneHeight(a_MaxSugarcaneHeight)
245  {
246  }
247 protected:
249  int m_Seed;
252 
254  bool TryAddSugarcane(cChunkDesc & a_ChunkDesc, int a_RelX, HEIGHTTYPE & a_RelY, int a_RelZ);
255 
257  bool TryAddCactus(cChunkDesc & a_ChunkDesc, int a_RelX, HEIGHTTYPE & a_RelY, int a_RelZ);
258 
259  // Returns true is the specified biome is a desert or its variant
260  static bool IsDesertVariant(EMCSBiome a_biome);
261 
262  // cFinishGen override:
263  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
264 } ;
265 
266 
267 
268 
269 
275  public cFinishGen
276 {
277 public:
278  typedef std::vector<BLOCKTYPE> BlockList;
279  bool m_IsAllowedBelow[256];
280 
281  typedef std::vector<EMCSBiome> BiomeList;
282  bool m_IsBiomeAllowed[256];
283 
284 
286  int a_Seed, BLOCKTYPE a_BlockType, BiomeList a_Biomes, int a_Amount,
287  BlockList a_AllowedBelow
288  ) :
289  m_Noise(a_Seed),
290  m_BlockType(a_BlockType),
291  m_Amount(a_Amount)
292  {
293  // Initialize all the block types.
294  for (size_t idx = 0; idx < ARRAYCOUNT(m_IsAllowedBelow); ++idx)
295  {
296  m_IsAllowedBelow[idx] = false;
297  }
298 
299  // Load the allowed blocks into m_IsAllowedBelow
300  for (BlockList::iterator itr = a_AllowedBelow.begin(); itr != a_AllowedBelow.end(); ++itr)
301  {
302  m_IsAllowedBelow[*itr] = true;
303  }
304 
305  // Initialize all the biome types.
306  for (size_t idx = 0; idx < ARRAYCOUNT(m_IsBiomeAllowed); ++idx)
307  {
308  m_IsBiomeAllowed[idx] = false;
309  }
310 
311  // Load the allowed biomes into m_IsBiomeAllowed
312  for (BiomeList::iterator itr = a_Biomes.begin(); itr != a_Biomes.end(); ++itr)
313  {
314  m_IsBiomeAllowed[*itr] = true;
315  }
316  }
317 
318 protected:
321 
323  int m_Amount;
324 
325 
326  int GetNumToGen(const cChunkDef::BiomeMap & a_BiomeMap);
327 
329  inline bool IsAllowedBiome(EMCSBiome a_Biome)
330  {
331  return m_IsBiomeAllowed[a_Biome];
332  }
333 
335  inline bool IsAllowedBlockBelow(BLOCKTYPE a_BlockBelow)
336  {
337  return m_IsAllowedBelow[a_BlockBelow];
338  }
339 
340 
341  // cFinishGen override:
342  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
343 } ;
344 
345 
346 
347 
348 
350  public cFinishGen
351 {
352 public:
353  cFinishGenBottomLava(int a_Level) :
354  m_Level(a_Level)
355  {
356  }
357 
358  int GetLevel(void) const { return m_Level; }
359 protected:
360  int m_Level;
361 
362  // cFinishGen override:
363  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
364 } ;
365 
366 
367 
368 
369 
371  public cFinishGen
372 {
373 public:
374  cFinishGenPreSimulator(bool a_PreSimulateFallingBlocks, bool a_PreSimulateWater, bool a_PreSimulateLava);
375 
376 protected:
377 
381 
383  void CollapseSandGravel(cChunkDesc & a_ChunkDesc);
384 
388  void StationarizeFluid(
389  cChunkDef::BlockTypes & a_BlockTypes, // Block types to read and change
390  cChunkDef::HeightMap & a_HeightMap, // Height map to read
391  BLOCKTYPE a_Fluid,
392  BLOCKTYPE a_StationaryFluid
393  );
394 
395  // cFinishGen override:
396  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
397 } ;
398 
399 
400 
401 
402 
404  public cFinishGen
405 {
406 public:
407  cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cIniFile & a_IniFile, eDimension a_Dimension);
408 
409 protected:
410 
414  int m_Chance;
415 
416  // cFinishGen override:
417  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
418 
420  bool TryPlaceSpring(cChunkDesc & a_ChunkDesc, int x, int y, int z);
421 } ;
422 
423 
424 
425 
426 
430  public cFinishGen
431 {
432 public:
433 
434  cFinishGenPassiveMobs(int a_Seed, cIniFile & a_IniFile, eDimension a_Dimension);
435 
436 protected:
437 
440 
443 
444 
445  // cFinishGen override:
446  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
447 
449  bool TrySpawnAnimals(cChunkDesc & a_ChunkDesc, int x, int y, int z, eMonsterType AnimalToSpawn);
450 
453  eMonsterType GetRandomMob(cChunkDesc & a_ChunkDesc);
454 } ;
455 
456 
457 
458 
459 
465  public cFinishGen
466 {
467  using Super = cFinishGen;
468 
469 public:
470 
471  struct OreInfo
472  {
473  BLOCKTYPE m_BlockType; // The type of the nest.
474  NIBBLETYPE m_BlockMeta; // The block meta
475  int m_MaxHeight; // The highest possible a nest can occur
476  int m_NumNests; // How many nests per chunk
477  int m_NestSize; // The amount of blocks a nest can have.
478 
480  m_BlockType(0),
481  m_BlockMeta(0),
482  m_MaxHeight(0),
483  m_NumNests(0),
484  m_NestSize(0)
485  {
486  }
487 
488  OreInfo(BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize) :
489  m_BlockType(a_OreType),
490  m_BlockMeta(a_OreMeta),
491  m_MaxHeight(a_MaxHeight),
492  m_NumNests(a_NumNests),
493  m_NestSize(a_NestSize)
494  {
495  }
496  };
497 
498  typedef std::vector<OreInfo> OreInfos;
499 
500  cFinishGenOres(int a_Seed, const OreInfos & a_OreInfos):
501  m_Noise(a_Seed),
502  m_OreInfos(a_OreInfos)
503  {
504  }
505 
506  // cFinishGen overrides:
507  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
508 
510  static const OreInfos & DefaultOverworldOres(void);
511 
513  static const OreInfos & DefaultNetherOres(void);
514 
516  static const OreInfos & DefaultNaturalPatches(void);
517 
521  static OreInfos OreInfosFromString(const AString & a_OreInfosString);
522 
526  static AString OreInfosToString(const OreInfos & a_OreInfos);
527 
529  void SetSeed(int a_Seed);
530 
531 protected:
534 
537 
538 
541  virtual void GenerateOre(
542  cChunkDesc & a_ChunkDesc,
543  BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta,
544  int a_MaxHeight, int a_NumNests, int a_NestSize,
545  int a_Seq
546  ) = 0;
547 
548  // TODO: Helper function to parse a config string into m_OreInfos
549 };
550 
551 
552 
553 
554 
556  public cFinishGenOres
557 {
559 
560 public:
561 
562  cFinishGenOreNests(int a_Seed, const OreInfos & a_OreInfos):
563  Super(a_Seed, a_OreInfos)
564  {}
565 
566 protected:
567 
568  // cFinishGenOreClumps overrides:
569  virtual void GenerateOre(
570  cChunkDesc & a_ChunkDesc,
571  BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta,
572  int a_MaxHeight, int a_NumNests, int a_NestSize,
573  int a_Seq
574  ) override;
575 } ;
576 
577 
578 
579 
580 
582  public cFinishGenOres
583 {
585 
586 public:
587 
588  cFinishGenOrePockets(int a_Seed, const OreInfos & a_OreInfos):
589  Super(a_Seed, a_OreInfos)
590  {}
591 
594  void Initialize(cIniFile & a_IniFile, const AString & a_GenName);
595 
596 protected:
597 
598  // cFinishGenOreClumps overrides:
599  virtual void GenerateOre(
600  cChunkDesc & a_ChunkDesc,
601  BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta,
602  int a_MaxNestHeight, int a_NumNests, int a_NestSize,
603  int a_Seq
604  ) override;
605 
609  int a_ChunkX, int a_ChunkZ,
610  cChunkDesc & a_ChunkDesc,
611  BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta,
612  int a_MaxHeight, int a_NumNests, int a_NestSize,
613  int a_Seq
614  );
615 
619  void imprintPocket(
620  cChunkDesc & a_ChunkDesc,
621  int a_MinPocketX, int a_PocketY, int a_MinPocketZ,
622  int a_NestSize, int a_Seq,
623  BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta
624  );
625 
627  void imprintSphere(
628  cChunkDesc & a_ChunkDesc,
629  double a_SphereX, double a_SphereY, double a_SphereZ, double a_Radius,
630  BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta
631  );
632 };
633 
634 
635 
636 
637 
639  public cFinishGen
640 {
641 public:
642  cFinishGenForestRocks(int a_Seed, cIniFile & a_IniFile);
643  virtual void GenFinish(cChunkDesc & a_ChunkDesc) override;
644 
645 private:
647 };
EMCSBiome
Biome IDs The first batch corresponds to the clientside biomes, used by MineCraft.
Definition: BiomeDef.h:18
unsigned char NIBBLETYPE
The datatype used by nibbledata (meta, light, skylight)
Definition: ChunkDef.h:44
unsigned char HEIGHTTYPE
The type used by the heightmap.
Definition: ChunkDef.h:47
unsigned char BLOCKTYPE
The datatype used by blockdata.
Definition: ChunkDef.h:41
eDimension
Dimension of a world.
Definition: Defines.h:231
#define ARRAYCOUNT(X)
Evaluates to the number of elements in an array (compile-time!)
Definition: Globals.h:231
eMonsterType
Identifies individual monster type.
Definition: MonsterTypes.h:11
std::string AString
Definition: StringUtils.h:11
Definition: FastNBT.h:132
BLOCKTYPE BlockTypes[NumBlocks]
The type used for block type operations and storage, AXIS_ORDER ordering.
Definition: ChunkDef.h:140
HEIGHTTYPE HeightMap[Width *Width]
The type used for any heightmap operations and storage; idx = x + Width * z; Height points to the hig...
Definition: ChunkDef.h:132
EMCSBiome BiomeMap[Width *Width]
The type used for any biomemap operations and storage inside Cuberite, using Cuberite biomes (need no...
Definition: ChunkDef.h:137
The interface that a finisher must implement Finisher implements changes to the chunk after the rough...
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1087
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1120
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:48
cFinishGenNetherClumpFoliage(int a_Seed)
Definition: FinishGen.h:57
void TryPlaceClump(cChunkDesc &a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, BLOCKTYPE a_Block)
Definition: FinishGen.cpp:92
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:185
static std::vector< BiomeInfo > ParseIniFile(cIniFile &a_IniFile, const AString &a_ClumpPrefix)
Parses an inifile in search for all clumps.
Definition: FinishGen.cpp:372
cFinishGenClumpTopBlock(int a_Seed, std::vector< BiomeInfo > a_BlockList)
Definition: FinishGen.h:114
const int MIN_NUM_FOLIAGE
The minimum number of foliage per clump.
Definition: FinishGen.h:136
const int MAX_NUM_FOLIAGE
The maximum number of foliage per clump.
Definition: FinishGen.h:133
std::vector< BiomeInfo > m_FlowersPerBiome
Definition: FinishGen.h:130
void TryPlaceFoliageClump(cChunkDesc &a_ChunkDesc, int a_RelX, int a_RelZ, BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, bool a_IsDoubleTall)
Definition: FinishGen.cpp:242
const int RANGE_FROM_CENTER
The maximum range a foliage can be placed from the center of the clump.
Definition: FinishGen.h:139
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.
Definition: FinishGen.cpp:287
FoliageInfo(BLOCKTYPE a_BlockType, NIBBLETYPE a_BlockMeta, int a_Weight)
Definition: FinishGen.h:86
std::vector< FoliageInfo > m_Blocks
Definition: FinishGen.h:98
BiomeInfo(int a_MinNumClumpsPerChunk, int a_MaxNumClumpsPerChunk, std::vector< FoliageInfo > a_Blocks)
Definition: FinishGen.h:106
void TryPlaceGlowstone(cChunkDesc &a_ChunkDesc, int a_RelX, int a_RelY, int a_RelZ, int a_Size, int a_NumStrings)
Definition: FinishGen.cpp:457
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:409
cFinishGenGlowStone(int a_Seed)
Definition: FinishGen.h:153
cFinishGenTallGrass(int a_Seed)
Definition: FinishGen.h:175
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:521
static bool CanFernGrow(EMCSBiome a_Biome)
Definition: FinishGen.cpp:628
static bool CanGrassGrow(EMCSBiome a_Biome)
Definition: FinishGen.cpp:717
static int GetBiomeDensity(EMCSBiome a_Biome)
Definition: FinishGen.cpp:683
static bool CanLargeFernGrow(EMCSBiome a_Biome)
Definition: FinishGen.cpp:652
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:763
cNoise m_Noise
Definition: FinishGen.h:207
cFinishGenVines(int a_Seed, int a_Level)
Definition: FinishGen.h:198
bool IsJungleVariant(EMCSBiome a_Biome)
Definition: FinishGen.cpp:740
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1035
cFinishGenSoulsandRims(int a_Seed)
Definition: FinishGen.h:221
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...
Definition: FinishGen.cpp:885
static bool IsDesertVariant(EMCSBiome a_biome)
Definition: FinishGen.cpp:1018
cFinishGenSprinkleFoliage(int a_Seed, int a_MaxCactusHeight, int a_MaxSugarcaneHeight)
Definition: FinishGen.h:240
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:945
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 (...
Definition: FinishGen.cpp:836
This class adds a single top block in random positions in the specified biome on top of specified all...
Definition: FinishGen.h:276
std::vector< EMCSBiome > BiomeList
Definition: FinishGen.h:281
bool m_IsBiomeAllowed[256]
Definition: FinishGen.h:282
cFinishGenSingleTopBlock(int a_Seed, BLOCKTYPE a_BlockType, BiomeList a_Biomes, int a_Amount, BlockList a_AllowedBelow)
Definition: FinishGen.h:285
bool m_IsAllowedBelow[256]
Definition: FinishGen.h:279
int m_Amount
Relative amount of blocks to try adding.
Definition: FinishGen.h:323
std::vector< BLOCKTYPE > BlockList
Definition: FinishGen.h:278
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1175
bool IsAllowedBlockBelow(BLOCKTYPE a_BlockBelow)
Returns true if the given blocktype may be below m_BlockType.
Definition: FinishGen.h:335
bool IsAllowedBiome(EMCSBiome a_Biome)
Returns true if the given biome is a biome that is allowed.
Definition: FinishGen.h:329
int GetNumToGen(const cChunkDef::BiomeMap &a_BiomeMap)
Definition: FinishGen.cpp:1158
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1223
int GetLevel(void) const
Definition: FinishGen.h:358
cFinishGenBottomLava(int a_Level)
Definition: FinishGen.h:353
cFinishGenPreSimulator(bool a_PreSimulateFallingBlocks, bool a_PreSimulateWater, bool a_PreSimulateLava)
Definition: FinishGen.cpp:1246
void CollapseSandGravel(cChunkDesc &a_ChunkDesc)
Drops hanging sand and gravel down to the ground, recalculates heightmap.
Definition: FinishGen.cpp:1281
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1258
void StationarizeFluid(cChunkDef::BlockTypes &a_BlockTypes, cChunkDef::HeightMap &a_HeightMap, BLOCKTYPE a_Fluid, BLOCKTYPE a_StationaryFluid)
For each fluid block:
Definition: FinishGen.cpp:1343
bool TryPlaceSpring(cChunkDesc &a_ChunkDesc, int x, int y, int z)
Tries to place a spring at the specified coords, checks neighbors.
Definition: FinishGen.cpp:1519
cProbabDistrib m_HeightDistribution
Definition: FinishGen.h:412
cFinishGenFluidSprings(int a_Seed, BLOCKTYPE a_Fluid, cIniFile &a_IniFile, eDimension a_Dimension)
Definition: FinishGen.cpp:1425
int m_Chance
Chance, [0..100], that a spring will be generated in a chunk.
Definition: FinishGen.h:414
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1476
This class populates generated chunks with packs of biome-dependant animals Animals: cows,...
Definition: FinishGen.h:431
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 ...
Definition: FinishGen.cpp:1648
int m_AnimalProbability
Chance, [0..100], that an animal pack will be generated in a chunk.
Definition: FinishGen.h:442
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1608
eMonsterType GetRandomMob(cChunkDesc &a_ChunkDesc)
Picks a random animal from biome-dependant list for a random position in the chunk.
Definition: FinishGen.cpp:1702
cFinishGenPassiveMobs(int a_Seed, cIniFile &a_IniFile, eDimension a_Dimension)
Definition: FinishGen.cpp:1571
cNoise m_Noise
The noise used as the source of randomness.
Definition: FinishGen.h:439
Base class for generators that have an ore list attached to them.
Definition: FinishGen.h:466
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:1734
static const OreInfos & DefaultOverworldOres(void)
Returns a vector of OreInfo structures describing the default Overworld ores, usable in the construct...
Definition: FinishGen.cpp:1755
static OreInfos OreInfosFromString(const AString &a_OreInfosString)
Parses the parameter string into OreInfos array.
Definition: FinishGen.cpp:1808
OreInfos m_OreInfos
All the ores enabled in this generator.
Definition: FinishGen.h:536
static const OreInfos & DefaultNetherOres(void)
Returns a vector of OreInfo structures describing the default Nether ores, usable in the constructor.
Definition: FinishGen.cpp:1776
cNoise m_Noise
The noise used for generating.
Definition: FinishGen.h:533
static AString OreInfosToString(const OreInfos &a_OreInfos)
Returns a string that represents the OreInfos given as the parameter.
Definition: FinishGen.cpp:1852
static const OreInfos & DefaultNaturalPatches(void)
Returns a vector of OreInfo structures describing the default Overworld non-ore pockets (dirt,...
Definition: FinishGen.cpp:1790
std::vector< OreInfo > OreInfos
Definition: FinishGen.h:498
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)
Definition: FinishGen.h:500
void SetSeed(int a_Seed)
(Re-)sets the seed used by the internal generating mechanisms.
Definition: FinishGen.cpp:1873
NIBBLETYPE m_BlockMeta
Definition: FinishGen.h:474
OreInfo(BLOCKTYPE a_OreType, NIBBLETYPE a_OreMeta, int a_MaxHeight, int a_NumNests, int a_NestSize)
Definition: FinishGen.h:488
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.
Definition: FinishGen.cpp:1885
cFinishGenOreNests(int a_Seed, const OreInfos &a_OreInfos)
Definition: FinishGen.h:562
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.
Definition: FinishGen.cpp:2066
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...
Definition: FinishGen.cpp:2089
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.
Definition: FinishGen.cpp:2122
cFinishGenOrePockets(int a_Seed, const OreInfos &a_OreInfos)
Definition: FinishGen.h:588
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.
Definition: FinishGen.cpp:2164
void Initialize(cIniFile &a_IniFile, const AString &a_GenName)
Reads the configuration from the specified INI file.
Definition: FinishGen.cpp:2042
virtual void GenFinish(cChunkDesc &a_ChunkDesc) override
Definition: FinishGen.cpp:2250
cFinishGenForestRocks(int a_Seed, cIniFile &a_IniFile)
Definition: FinishGen.cpp:2242
Definition: Noise.h:20