2026-03-01 12:16:08 +08:00
# pragma once
using namespace std ;
# include "LevelSource.h"
# include "Mob.h"
# include "WeighedRandom.h"
class Feature ;
class MobCategory ;
class BiomeDecorator ;
class TreeFeature ;
class BasicTree ;
class BirchFeature ;
class SwampTreeFeature ;
class ChunkRebuildData ;
class Biome
{
friend class ChunkRebuildData ;
public :
// 4J JEV, replaces the static blocks.
static void staticCtor ( ) ;
static Biome * biomes [ 256 ] ;
static Biome * ocean ;
static Biome * plains ;
static Biome * desert ;
static Biome * extremeHills ;
static Biome * forest ;
static Biome * taiga ;
static Biome * swampland ;
static Biome * river ;
static Biome * hell ;
static Biome * sky ;
static Biome * frozenOcean ;
static Biome * frozenRiver ;
static Biome * iceFlats ;
static Biome * iceMountains ;
static Biome * mushroomIsland ;
static Biome * mushroomIslandShore ;
static Biome * beaches ;
static Biome * desertHills ;
static Biome * forestHills ;
static Biome * taigaHills ;
static Biome * smallerExtremeHills ;
static Biome * jungle ;
static Biome * jungleHills ;
static const int BIOME_COUNT = 23 ; // 4J Stu added
public :
wstring m_name ;
2026-03-03 03:04:10 +08:00
int color ;
byte topMaterial ;
byte material ;
int leafColor ;
float depth ;
float scale ;
float temperature ;
float downfall ;
2026-03-01 12:16:08 +08:00
//int waterColor; // 4J Stu removed
2026-03-03 03:04:10 +08:00
BiomeDecorator * decorator ;
2026-03-01 12:16:08 +08:00
const int id ;
2026-03-03 03:04:10 +08:00
class MobSpawnerData : public WeighedRandomItem
2026-03-01 12:16:08 +08:00
{
public :
eINSTANCEOF mobClass ;
int minCount ;
int maxCount ;
2026-03-03 03:04:10 +08:00
MobSpawnerData ( eINSTANCEOF mobClass , int probabilityWeight , int minCount , int maxCount ) : WeighedRandomItem ( probabilityWeight )
2026-03-01 12:16:08 +08:00
{
this - > mobClass = mobClass ;
this - > minCount = minCount ;
this - > maxCount = maxCount ;
2026-03-03 03:04:10 +08:00
}
} ;
2026-03-01 12:16:08 +08:00
protected :
2026-03-03 03:04:10 +08:00
vector < MobSpawnerData * > enemies ;
vector < MobSpawnerData * > friendlies ;
vector < MobSpawnerData * > waterFriendlies ;
2026-03-01 12:16:08 +08:00
vector < MobSpawnerData * > friendlies_chicken ;
vector < MobSpawnerData * > friendlies_wolf ;
vector < MobSpawnerData * > friendlies_mushroomcow ;
2026-03-03 03:04:10 +08:00
vector < MobSpawnerData * > ambientFriendlies ;
2026-03-01 12:16:08 +08:00
Biome ( int id ) ;
~ Biome ( ) ;
2026-03-03 03:04:10 +08:00
2026-03-01 12:16:08 +08:00
BiomeDecorator * createDecorator ( ) ;
private :
Biome * setTemperatureAndDownfall ( float temp , float downfall ) ;
2026-03-03 03:04:10 +08:00
Biome * setDepthAndScale ( float depth , float scale ) ;
2026-03-01 12:16:08 +08:00
bool snowCovered ;
2026-03-03 03:04:10 +08:00
bool _hasRain ;
2026-03-01 12:16:08 +08:00
// 4J Added
eMinecraftColour m_grassColor ;
eMinecraftColour m_foliageColor ;
eMinecraftColour m_waterColor ;
eMinecraftColour m_skyColor ;
2026-03-03 03:04:10 +08:00
Biome * setNoRain ( ) ;
2026-03-01 12:16:08 +08:00
protected :
/* removing these so that we can consistently return newly created trees via getTreeFeature, and let the calling function be resposible for deleting the returned tree
TreeFeature * normalTree ;
2026-03-03 03:04:10 +08:00
BasicTree * fancyTree ;
BirchFeature * birchTree ;
SwampTreeFeature * swampTree ;
2026-03-01 12:16:08 +08:00
*/
public :
2026-03-03 03:04:10 +08:00
virtual Feature * getTreeFeature ( Random * random ) ;
2026-03-01 12:16:08 +08:00
virtual Feature * getGrassFeature ( Random * random ) ;
protected :
Biome * setSnowCovered ( ) ;
2026-03-03 03:04:10 +08:00
Biome * setName ( const wstring & name ) ;
Biome * setLeafColor ( int leafColor ) ;
Biome * setColor ( int color ) ;
2026-03-01 12:16:08 +08:00
// 4J Added
Biome * setLeafFoliageWaterSkyColor ( eMinecraftColour grassColor , eMinecraftColour foliageColor , eMinecraftColour waterColour , eMinecraftColour skyColour ) ;
public :
2026-03-03 03:04:10 +08:00
virtual int getSkyColor ( float temp ) ;
2026-03-01 12:16:08 +08:00
2026-03-03 03:04:10 +08:00
vector < MobSpawnerData * > * getMobs ( MobCategory * category ) ;
2026-03-01 12:16:08 +08:00
2026-03-03 03:04:10 +08:00
virtual bool hasSnow ( ) ;
virtual bool hasRain ( ) ;
2026-03-01 12:16:08 +08:00
virtual bool isHumid ( ) ;
2026-03-03 03:04:10 +08:00
virtual float getCreatureProbability ( ) ;
virtual int getDownfallInt ( ) ;
virtual int getTemperatureInt ( ) ;
2026-03-01 12:16:08 +08:00
virtual float getDownfall ( ) ; // 4J - brought forward from 1.2.3
virtual float getTemperature ( ) ; // 4J - brought forward from 1.2.3
2026-03-03 03:04:10 +08:00
virtual void decorate ( Level * level , Random * random , int xo , int zo ) ;
2026-03-01 12:16:08 +08:00
2026-03-03 03:04:10 +08:00
virtual int getGrassColor ( ) ;
virtual int getFolageColor ( ) ;
2026-03-01 12:16:08 +08:00
virtual int getWaterColor ( ) ; // 4J Added
} ;