fixed superflat

This commit is contained in:
GameHerobrine 2023-12-02 14:16:27 +03:00
parent ea3babff02
commit 284910734f
2 changed files with 5 additions and 4 deletions

View file

@ -151,9 +151,9 @@ class NormalGenerator implements NewLevelGenerator{
$chunk .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; //skylight/light
}
}
$this->level->level->setBiomeIdArrayForChunk($chunkX, $chunkZ, $biomes);
$this->level->setMiniChunk($chunkX, $chunkZ, $chunkY, $chunk);
}
$this->level->level->setBiomeIdArrayForChunk($chunkX, $chunkZ, $biomes);
if(self::HIDDEN_FEATURES) $this->caveGenerator->generate($this->level, $chunkX, $chunkZ); //TODO speedup
}

View file

@ -7,7 +7,7 @@ require_once("LevelGenerator.php");
class SuperflatGenerator implements LevelGenerator{
private $level, $random, $structure, $chunks, $options, $floorLevel, $populators = [];
public $preset;
public function __construct(array $options = []){
$this->preset = "2;7,59x1,3x3,2;1;spawn(radius=10 block=89),decoration(treecount=80 grasscount=45)";
$this->options = $options;
@ -78,9 +78,9 @@ class SuperflatGenerator implements LevelGenerator{
$metas = "";
for($y = $startY; $y < $endY; ++$y){
$blocks .= chr($this->structure[$y]->getID());
$metas .= substr(dechex($this->structure[$y]->getMetadata()), -1);
$metas .= chr($this->structure[$y]->getMetadata());
}
$this->chunks[$Y] .= $blocks . hex2bin($metas) . "\x00\x00\x00\x00\x00\x00\x00\x00";
$this->chunks[$Y] .= $blocks . $metas . "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00" . "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00";
}
}
}
@ -111,6 +111,7 @@ class SuperflatGenerator implements LevelGenerator{
for($Y = 0; $Y < 8; ++$Y){
$this->level->setMiniChunk($chunkX, $chunkZ, $Y, $this->chunks[$Y]);
}
$this->level->level->setBiomeIdArrayForChunk($chunkX, $chunkZ, str_repeat(chr(BIOME_PLAINS), 256));
}
public function populateChunk($chunkX, $chunkZ){