GenisysPro  for Minecraft PE/Windows 10 v1.1.x
Feature-rich server software for Minecraft PE and Windows 10 Edition
Biome Class Reference

Public Member Functions

 clearPopulators ()
 
 addPopulator (Populator $populator)
 
 removePopulator ($class)
 
 populateChunk (ChunkManager $level, $chunkX, $chunkZ, Random $random)
 
 getPopulators ()
 
 setId ($id)
 
 getId ()
 
 getName ()
 
 getMinElevation ()
 
 getMaxElevation ()
 
 setElevation ($min, $max)
 
 getGroundCover ()
 
 setGroundCover (array $covers)
 
 getTemperature ()
 
 getRainfall ()
 

Static Public Member Functions

static init ()
 
static getBiome ($id)
 

Data Fields

const OCEAN = 0
 
const PLAINS = 1
 
const DESERT = 2
 
const MOUNTAINS = 3
 
const FOREST = 4
 
const TAIGA = 5
 
const SWAMP = 6
 
const RIVER = 7
 
const HELL = 8
 
const END = 9
 
const FROZEN_OCEAN = 10
 
const FROZEN_RIVER = 11
 
const ICE_PLAINS = 12
 
const ICE_MOUNTAINS = 13
 
const MUSHROOM_ISLAND = 14
 
const MUSHROOM_ISLAND_SHORE = 15
 
const BEACH = 16
 
const DESERT_HILLS = 17
 
const FOREST_HILLS = 18
 
const TAIGA_HILLS = 19
 
const SMALL_MOUNTAINS = 20
 
const BIRCH_FOREST = 27
 
const BIRCH_FOREST_HILLS = 28
 
const ROOFED_FOREST = 29
 
const COLD_TAIGA = 30
 
const COLD_TAIGA_HILLS = 31
 
const MEGA_TAIGA = 32
 
const MEGA_TAIGA_HILLS = 33
 
const EXTREME_HILLS_PLUS = 34
 
const SAVANNA = 35
 
const SAVANNA_PLATEAU = 36
 
const MESA = 37
 
const MESA_PLATEAU_F = 38
 
const MESA_PLATEAU = 39
 
const VOID = 127
 
const MAX_BIOMES = 256
 

Static Protected Member Functions

static register ($id, Biome $biome)
 

Protected Attributes

 $rainfall = 0.5
 
 $temperature = 0.5
 

Member Function Documentation

◆ addPopulator()

addPopulator ( Populator  $populator)
Parameters
Populator$populator
161  {
162  $this->populators[get_class($populator)] = $populator;
163  }

◆ clearPopulators()

clearPopulators ( )
154  {
155  $this->populators = [];
156  }

◆ getBiome()

static getBiome (   $id)
static
Parameters
$id
Returns
Biome
150  {
151  return isset(self::$biomes[$id]) ? self::$biomes[$id] : self::$biomes[self::OCEAN];
152  }

◆ getGroundCover()

getGroundCover ( )
Returns
Block[]
229  {
230  return $this->groundCover;
231  }

◆ getId()

getId ( )
203  {
204  return $this->id;
205  }

◆ getMaxElevation()

getMaxElevation ( )
213  {
214  return $this->maxElevation;
215  }

◆ getMinElevation()

getMinElevation ( )
209  {
210  return $this->minElevation;
211  }

◆ getName()

getName ( )
abstract

◆ getPopulators()

getPopulators ( )
Returns
Populator[]
189  {
190  return $this->populators;
191  }

◆ getRainfall()

getRainfall ( )
Returns
float
250  {
251  return $this->rainfall;
252  }

◆ getTemperature()

getTemperature ( )
Returns
float
243  {
244  return $this->temperature;
245  }

◆ init()

static init ( )
static
123  {
124  self::register(self::OCEAN, new OceanBiome());
125  self::register(self::PLAINS, new PlainBiome());
126  self::register(self::DESERT, new DesertBiome());
127  self::register(self::MOUNTAINS, new MountainsBiome());
128  self::register(self::FOREST, new ForestBiome());
129  self::register(self::TAIGA, new TaigaBiome());
130  self::register(self::SWAMP, new SwampBiome());
131  self::register(self::RIVER, new RiverBiome());
132 
133  self::register(self::BEACH, new BeachBiome());
134  self::register(self::MESA, new MesaBiome());
135 
136  self::register(self::ICE_PLAINS, new IcePlainsBiome());
137 
138 
139  self::register(self::SMALL_MOUNTAINS, new SmallMountainsBiome());
140  self::register(self::HELL, new HellBiome());
141 
142  self::register(self::BIRCH_FOREST, new ForestBiome(ForestBiome::TYPE_BIRCH));
143  }

◆ populateChunk()

populateChunk ( ChunkManager  $level,
  $chunkX,
  $chunkZ,
Random  $random 
)
Parameters
ChunkManager$level
$chunkX
$chunkZ
Random$random
180  {
181  foreach($this->populators as $populator){
182  $populator->populate($level, $chunkX, $chunkZ, $random);
183  }
184  }

◆ register()

static register (   $id,
Biome  $biome 
)
staticprotected
Parameters
$id
Biome$biome
104  {
105  self::$biomes[(int) $id] = $biome;
106  $biome->setId((int) $id);
107 
108  $flowerPopFound = false;
109 
110  foreach($biome->getPopulators() as $populator){
111  if($populator instanceof Flower){
112  $flowerPopFound = true;
113  break;
114  }
115  }
116 
117  if($flowerPopFound === false){
118  $flower = new Flower();
119  $biome->addPopulator($flower);
120  }
121  }

◆ removePopulator()

removePopulator (   $class)
Parameters
$class
168  {
169  if(isset($this->populators[$class])){
170  unset($this->populators[$class]);
171  }
172  }

◆ setElevation()

setElevation (   $min,
  $max 
)
Parameters
$min
$max
221  {
222  $this->minElevation = $min;
223  $this->maxElevation = $max;
224  }

◆ setGroundCover()

setGroundCover ( array  $covers)
Parameters
Block[]$covers
236  {
237  $this->groundCover = $covers;
238  }

◆ setId()

setId (   $id)
Parameters
$id
196  {
197  if(!$this->registered){
198  $this->registered = true;
199  $this->id = $id;
200  }
201  }

Field Documentation

◆ $rainfall

$rainfall = 0.5
protected

◆ $temperature

$temperature = 0.5
protected

◆ BEACH

const BEACH = 16

◆ BIRCH_FOREST

const BIRCH_FOREST = 27

◆ BIRCH_FOREST_HILLS

const BIRCH_FOREST_HILLS = 28

◆ COLD_TAIGA

const COLD_TAIGA = 30

◆ COLD_TAIGA_HILLS

const COLD_TAIGA_HILLS = 31

◆ DESERT

const DESERT = 2

◆ DESERT_HILLS

const DESERT_HILLS = 17

◆ END

const END = 9

◆ EXTREME_HILLS_PLUS

const EXTREME_HILLS_PLUS = 34

◆ FOREST

const FOREST = 4

◆ FOREST_HILLS

const FOREST_HILLS = 18

◆ FROZEN_OCEAN

const FROZEN_OCEAN = 10

◆ FROZEN_RIVER

const FROZEN_RIVER = 11

◆ HELL

const HELL = 8

◆ ICE_MOUNTAINS

const ICE_MOUNTAINS = 13

◆ ICE_PLAINS

const ICE_PLAINS = 12

◆ MAX_BIOMES

const MAX_BIOMES = 256

◆ MEGA_TAIGA

const MEGA_TAIGA = 32

◆ MEGA_TAIGA_HILLS

const MEGA_TAIGA_HILLS = 33

◆ MESA

const MESA = 37

◆ MESA_PLATEAU

const MESA_PLATEAU = 39

◆ MESA_PLATEAU_F

const MESA_PLATEAU_F = 38

◆ MOUNTAINS

const MOUNTAINS = 3

◆ MUSHROOM_ISLAND

const MUSHROOM_ISLAND = 14

◆ MUSHROOM_ISLAND_SHORE

const MUSHROOM_ISLAND_SHORE = 15

◆ OCEAN

const OCEAN = 0

◆ PLAINS

const PLAINS = 1

◆ RIVER

const RIVER = 7

◆ ROOFED_FOREST

const ROOFED_FOREST = 29

◆ SAVANNA

const SAVANNA = 35

◆ SAVANNA_PLATEAU

const SAVANNA_PLATEAU = 36

◆ SMALL_MOUNTAINS

const SMALL_MOUNTAINS = 20

◆ SWAMP

const SWAMP = 6

◆ TAIGA

const TAIGA = 5

◆ TAIGA_HILLS

const TAIGA_HILLS = 19

◆ VOID

const VOID = 127

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