mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
added all genisys biomes
This commit is contained in:
parent
8df552c372
commit
7052af0609
11 changed files with 151 additions and 2 deletions
|
|
@ -134,6 +134,8 @@ require_once(FILE_PATH . "/src/world/generator/LevelGenerator.php");
|
|||
require_once(FILE_PATH . "/src/world/generator/biome/Biome.php");
|
||||
require_once(FILE_PATH . "/src/world/generator/biome/BiomeSelector.php");
|
||||
require_once(FILE_PATH . "/src/world/generator/biome/biomes/BiomeWithGrass.php");
|
||||
require_once(FILE_PATH . "/src/world/generator/biome/biomes/BiomeWithSand.php");
|
||||
require_once(FILE_PATH . "/src/world/generator/biome/biomes/BiomeWithSnow.php");
|
||||
require_once(FILE_PATH . "/src/world/generator/biome/biomes/BiomeExtremeHills.php");
|
||||
|
||||
require_all(FILE_PATH . "src/");
|
||||
|
|
|
|||
|
|
@ -49,6 +49,13 @@ abstract class Biome{
|
|||
BiomeSelector::registerBiome(new BiomePlains(BIOME_PLAINS, "Plains"));
|
||||
BiomeSelector::registerBiome(new BiomeExtremeHillsEdge(BIOME_EXTREME_HILLS_EDGE, "Extreme Hills Edge"));
|
||||
BiomeSelector::registerBiome(new BiomeRiver(BIOME_RIVER, "River"));
|
||||
BiomeSelector::registerBiome(new BiomeOcean(BIOME_OCEAN, "Ocean"));
|
||||
BiomeSelector::registerBiome(new BiomeSwamp(BIOME_SWAMP, "Swamp"));
|
||||
BiomeSelector::registerBiome(new BiomeIcePlains(BIOME_ICE_PLAINS, "Ice Plains"));
|
||||
BiomeSelector::registerBiome(new BiomeDesert(BIOME_DESERT, "Desert"));
|
||||
BiomeSelector::registerBiome(new BiomeTaiga(BIOME_TAIGA, "Taiga"));
|
||||
BiomeSelector::registerBiome(new BiomeForest(BIOME_FOREST, "Forest"));
|
||||
BiomeSelector::registerBiome(new BiomeForest(BIOME_BIRCH_FOREST, "Birch Forest"));
|
||||
}
|
||||
|
||||
private static $initialized = false;
|
||||
|
|
|
|||
|
|
@ -45,8 +45,30 @@ class BiomeSelector
|
|||
}
|
||||
|
||||
public function getBiomeTR($t, $r){
|
||||
if($r < 0.60){
|
||||
return BIOME_PLAINS;
|
||||
if($r < 0.25){
|
||||
if($t < 0.7){
|
||||
return BIOME_OCEAN;
|
||||
}else if($t < 0.85){
|
||||
return BIOME_RIVER;
|
||||
}else{
|
||||
return BIOME_SWAMP;
|
||||
}
|
||||
}else if($r < 0.60){
|
||||
if($t < 0.25){
|
||||
return BIOME_ICE_PLAINS;
|
||||
}else if($t < 0.75){
|
||||
return BIOME_PLAINS;
|
||||
}else{
|
||||
return BIOME_DESERT;
|
||||
}
|
||||
}else if($r < 0.80){
|
||||
if($t < 0.25){
|
||||
return BIOME_TAIGA;
|
||||
}else if($t < 0.75){
|
||||
return BIOME_FOREST;
|
||||
}else{
|
||||
return BIOME_BIRCH_FOREST;
|
||||
}
|
||||
}else{
|
||||
if($t < 0.25){
|
||||
return BIOME_EXTREME_HILLS;
|
||||
|
|
|
|||
10
src/world/generator/biome/biomes/BiomeDesert.php
Normal file
10
src/world/generator/biome/biomes/BiomeDesert.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
class BiomeDesert extends BiomeWithSand
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
$this->setMinMax(63, 74);
|
||||
}
|
||||
}
|
||||
|
||||
11
src/world/generator/biome/biomes/BiomeForest.php
Normal file
11
src/world/generator/biome/biomes/BiomeForest.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class BiomeForest extends BiomeWithGrass
|
||||
{
|
||||
public function __construct($id, $name){ //TODO tree populators
|
||||
parent::__construct($id, $name);
|
||||
|
||||
$this->setMinMax(63, 81);
|
||||
}
|
||||
}
|
||||
|
||||
11
src/world/generator/biome/biomes/BiomeIcePlains.php
Normal file
11
src/world/generator/biome/biomes/BiomeIcePlains.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class BiomeIcePlains extends BiomeWithSnow
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
|
||||
$this->setMinMax(63, 74);
|
||||
}
|
||||
}
|
||||
|
||||
11
src/world/generator/biome/biomes/BiomeOcean.php
Normal file
11
src/world/generator/biome/biomes/BiomeOcean.php
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<?php
|
||||
|
||||
class BiomeOcean extends BiomeWithGrass
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
//TODO pop sugarcane, tallgrass
|
||||
$this->setMinMax(46, 68);
|
||||
}
|
||||
}
|
||||
|
||||
20
src/world/generator/biome/biomes/BiomeSwamp.php
Normal file
20
src/world/generator/biome/biomes/BiomeSwamp.php
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
<?php
|
||||
|
||||
class BiomeSwamp extends BiomeWithGrass
|
||||
{
|
||||
public function __construct($id, $name){ //TODO more beautiful?
|
||||
parent::__construct($id, $name);
|
||||
/*$flower = new Flower();
|
||||
$flower->setBaseAmount(8);
|
||||
$flower->addType([Block::RED_FLOWER, FlowerBlock::TYPE_BLUE_ORCHID]);
|
||||
|
||||
$this->addPopulator($flower);
|
||||
|
||||
$lilypad = new LilyPad();
|
||||
$lilypad->setBaseAmount(4);
|
||||
$this->addPopulator($lilypad);
|
||||
*/
|
||||
$this->setMinMax(62, 63);
|
||||
}
|
||||
}
|
||||
|
||||
17
src/world/generator/biome/biomes/BiomeTaiga.php
Normal file
17
src/world/generator/biome/biomes/BiomeTaiga.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class BiomeTaiga extends BiomeWithSnow
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
|
||||
$this->setMinMax(63, 81);
|
||||
$this->setTopBlocks([
|
||||
[PODZOL, 0],
|
||||
[DIRT, 0],
|
||||
[DIRT, 0],
|
||||
[DIRT, 0],
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
21
src/world/generator/biome/biomes/BiomeWithSand.php
Normal file
21
src/world/generator/biome/biomes/BiomeWithSand.php
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
<?php
|
||||
|
||||
class BiomeWithSand extends Biome
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
$this->setMinMax(63, 81);
|
||||
$this->setTopBlocks([
|
||||
[SAND, 0],
|
||||
[SAND, 0],
|
||||
[SAND, 0],
|
||||
[SAND, 0],
|
||||
[SANDSTONE, 0],
|
||||
[SANDSTONE, 0],
|
||||
[SANDSTONE, 0],
|
||||
[SANDSTONE, 0],
|
||||
]);
|
||||
$this->setFillerBlock(STONE);
|
||||
}
|
||||
}
|
||||
|
||||
17
src/world/generator/biome/biomes/BiomeWithSnow.php
Normal file
17
src/world/generator/biome/biomes/BiomeWithSnow.php
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
<?php
|
||||
|
||||
class BiomeWithSnow extends Biome
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
$this->setTopBlocks([
|
||||
[SNOW_LAYER, 0],
|
||||
[GRASS, 0],
|
||||
[DIRT, 0],
|
||||
[DIRT, 0],
|
||||
[DIRT, 0],
|
||||
]);
|
||||
$this->setFillerBlock(STONE);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue