mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 19:49:44 +00:00
water should spawn, more biomes
This commit is contained in:
parent
3e3bc76ae0
commit
8df552c372
7 changed files with 39 additions and 4 deletions
|
|
@ -134,6 +134,7 @@ 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/BiomeExtremeHills.php");
|
||||
|
||||
require_all(FILE_PATH . "src/");
|
||||
|
||||
|
|
|
|||
|
|
@ -146,7 +146,6 @@ class ExperimentalGenerator implements NewLevelGenerator{
|
|||
}
|
||||
$minSum /= $weightSum;
|
||||
$maxSum /= $weightSum;
|
||||
|
||||
for($y = $startY; $y < $endY; ++$y){
|
||||
if($y === 0){
|
||||
$chunk .= "\x07";
|
||||
|
|
@ -161,6 +160,8 @@ class ExperimentalGenerator implements NewLevelGenerator{
|
|||
|
||||
if($noiseValue > 0){
|
||||
$chunk .= "\x01";
|
||||
}elseif($y <= $this->waterHeight){
|
||||
$chunk .= "\x09";
|
||||
}else{
|
||||
$chunk .= "\x00";
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ abstract class Biome{
|
|||
public static function init(){
|
||||
BiomeSelector::registerBiome(new BiomeExtremeHills(BIOME_EXTREME_HILLS, "Extreme Hills"));
|
||||
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"));
|
||||
}
|
||||
|
||||
private static $initialized = false;
|
||||
|
|
|
|||
|
|
@ -48,8 +48,12 @@ class BiomeSelector
|
|||
if($r < 0.60){
|
||||
return BIOME_PLAINS;
|
||||
}else{
|
||||
if($t < 0.70){
|
||||
if($t < 0.25){
|
||||
return BIOME_EXTREME_HILLS;
|
||||
}else if($t < 0.70){
|
||||
return BIOME_EXTREME_HILLS_EDGE;
|
||||
}else{
|
||||
return BIOME_RIVER;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
10
src/world/generator/biome/biomes/BiomeExtremeHillsEdge.php
Normal file
10
src/world/generator/biome/biomes/BiomeExtremeHillsEdge.php
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
<?php
|
||||
|
||||
class BiomeExtremeHillsEdge extends BiomeExtremeHills
|
||||
{
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
$this->setMinMax(63, 97);
|
||||
}
|
||||
}
|
||||
|
||||
18
src/world/generator/biome/biomes/BiomeRiver.php
Normal file
18
src/world/generator/biome/biomes/BiomeRiver.php
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
<?php
|
||||
|
||||
class BiomeRiver extends BiomeWithGrass{
|
||||
|
||||
public function __construct($id, $name){
|
||||
parent::__construct($id, $name);
|
||||
|
||||
/*$sugarcane = new Sugarcane();
|
||||
$sugarcane->setBaseAmount(6);
|
||||
$tallGrass = new TallGrass();
|
||||
$tallGrass->setBaseAmount(5);
|
||||
|
||||
$this->addPopulator($sugarcane);
|
||||
$this->addPopulator($tallGrass);
|
||||
*/
|
||||
$this->setMinMax(58, 62);
|
||||
}
|
||||
}
|
||||
|
|
@ -4,8 +4,7 @@ class GroundCover extends Populator
|
|||
{
|
||||
public function populate(Level $level, $chunkX, $chunkZ, Random $random)
|
||||
{
|
||||
console("gcpop: $chunkX $chunkZ");
|
||||
$waterHeight = 0; //TODO
|
||||
$waterHeight = 63;
|
||||
for($x = 0; $x < 16; ++$x){
|
||||
for($z = 0; $z < 16; ++$z){
|
||||
$pcx = ($chunkX << 4) + $x;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue