This commit is contained in:
GameHerobrine 2023-12-19 22:34:04 +03:00
parent 6d430c3440
commit b84093e4ce
25 changed files with 48 additions and 163 deletions

View file

@ -25,7 +25,7 @@ class MobSpawner{
$phase = $this->server->api->time->getPhase($this->level);
if(self::$spawnAnimals && ($phase == "day" || $phase == "sunrise")){ //Animal
$type = mt_rand(10, 13);
$baby = false; //TODO baby
$baby = false;
$grassOnly = true;
}elseif(self::$spawnMobs && ($phase == "night" || $phase == "sunset")){ //Monster, true night
$type = mt_rand(32, 35);

View file

@ -32,12 +32,9 @@ class NoiseGeneratorPerlin extends NoiseGenerator{
$d3 = $d + $this->xCoord;
$d4 = $d1 + $this->yCoord;
$d5 = $d2 + $this->zCoord;
$i = (int) $d3;
$j = (int) $d4;
$k = (int) $d5;
if($d3 < $i) --$i;
if($d4 < $j) --$j;
if($d5 < $k) --$k;
$i = floor($d3);
$j = floor($d4);
$k = floor($d5);
$l = $i & 0xff;
$i1 = $j & 0xff;
$j1 = $k & 0xff;

View file

@ -98,13 +98,11 @@ class VanillaGenerator implements LevelGenerator
for($i8 = 0; $i8 < 8; ++$i8){
OreFeature::place($this->level, $this->rand, $chunkXWorld + $this->rand->nextInt(16), $this->rand->nextInt(16), $chunkZWorld + $this->rand->nextInt(16), REDSTONE_ORE, 7);
}
//for($i9 = 0; $i9 < 1; ++$i9){ //TODO loop is not neccessary
OreFeature::place($this->level, $this->rand, $chunkXWorld + $this->rand->nextInt(16), $this->rand->nextInt(16), $chunkZWorld + $this->rand->nextInt(16), DIAMOND_ORE, 7);
//}
//for($i10 = 0; $i10 < 1; ++$i10){
OreFeature::place($this->level, $this->rand, $chunkXWorld + $this->rand->nextInt(16), $this->rand->nextInt(16) + $this->rand->nextInt(16), $chunkZWorld + $this->rand->nextInt(16), LAPIS_ORE, 6);
//}
//sample= (int) ((((this.treeNoise.getValue(chunkXWorld * 0.5f, chunkZWorld * 0.5f) / 8.0f) + (this.rand.nextFloat() * 4.0f)) + 4.0f) / 3.0f);
$sample = (int) (((($this->treeNoise->getValue($chunkXWorld * 0.5, $chunkZWorld * 0.5) / 8) + ($this->rand->nextFloat() * 4)) + 4) / 3);
$treesAmount = $this->rand->nextInt(10) == 0;
if($biome == Biome::$forest) $treesAmount += $sample + 2;
@ -166,7 +164,6 @@ class VanillaGenerator implements LevelGenerator
}
$this->level->level->chunkChange[$index][-1] = true;
//console($this->level->level->getBlockID($chunkX*16, 20, $chunkZ*16));
}
public function populateLevel()