Cuberite
A lightweight, fast and extensible game server for Minecraft
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cFinishGenPassiveMobs Class Reference

This class populates generated chunks with packs of biome-dependant animals Animals: cows, sheep, pigs, mooshrooms, squid, horses, wolves, ocelots. More...

#include <FinishGen.h>

Inheritance diagram for cFinishGenPassiveMobs:
Inheritance graph
[legend]
Collaboration diagram for cFinishGenPassiveMobs:
Collaboration graph
[legend]

Public Member Functions

 cFinishGenPassiveMobs (int a_Seed, cIniFile &a_IniFile, eDimension a_Dimension)
 
- Public Member Functions inherited from cFinishGen
virtual ~cFinishGen ()
 

Protected Member Functions

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. More...
 
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 returns true. More...
 

Protected Attributes

int m_AnimalProbability
 Chance, [0..100], that an animal pack will be generated in a chunk. More...
 
cNoise m_Noise
 The noise used as the source of randomness. More...
 

Detailed Description

This class populates generated chunks with packs of biome-dependant animals Animals: cows, sheep, pigs, mooshrooms, squid, horses, wolves, ocelots.

Definition at line 429 of file FinishGen.h.

Constructor & Destructor Documentation

◆ cFinishGenPassiveMobs()

cFinishGenPassiveMobs::cFinishGenPassiveMobs ( int  a_Seed,
cIniFile a_IniFile,
eDimension  a_Dimension 
)

Definition at line 1571 of file FinishGen.cpp.

Member Function Documentation

◆ GenFinish()

void cFinishGenPassiveMobs::GenFinish ( cChunkDesc a_ChunkDesc)
overrideprotectedvirtual

Implements cFinishGen.

Definition at line 1608 of file FinishGen.cpp.

◆ GetRandomMob()

eMonsterType cFinishGenPassiveMobs::GetRandomMob ( cChunkDesc a_ChunkDesc)
protected

Picks a random animal from biome-dependant list for a random position in the chunk.

Returns the chosen mob type, or mtInvalid if no mob chosen.

Definition at line 1702 of file FinishGen.cpp.

◆ TrySpawnAnimals()

bool cFinishGenPassiveMobs::TrySpawnAnimals ( cChunkDesc a_ChunkDesc,
int  x,
int  y,
int  z,
eMonsterType  AnimalToSpawn 
)
protected

Returns false if an animal cannot spawn at given coords, else adds it to the chunk's entity list and returns true.

Definition at line 1648 of file FinishGen.cpp.

Member Data Documentation

◆ m_AnimalProbability

int cFinishGenPassiveMobs::m_AnimalProbability
protected

Chance, [0..100], that an animal pack will be generated in a chunk.

Definition at line 442 of file FinishGen.h.

◆ m_Noise

cNoise cFinishGenPassiveMobs::m_Noise
protected

The noise used as the source of randomness.

Definition at line 439 of file FinishGen.h.


The documentation for this class was generated from the following files: