added a temp fix for normalgen

This commit is contained in:
GameHerobrine 2023-03-07 22:23:35 +03:00
parent f829d6a693
commit 1a8ef21f19
2 changed files with 5 additions and 2 deletions

View file

@ -206,7 +206,7 @@ class PMFLevel extends PMF{
$X = $x >> 4;
$Z = $z >> 4;
$index = $this->getIndex($X, $Z);
if(!isset($this->chunks[$index])){
if(!isset($this->chunkInfo[$index])){
return 0;
}
$aX = $x & 15;
@ -254,7 +254,9 @@ class PMFLevel extends PMF{
$chunk = @gzopen($this->getChunkPath($X, $Z), "wb" . PMF_LEVEL_DEFLATE_LEVEL);
$bitmap = 0;
gzwrite($chunk, $this->chunkInfo[$index][0]);
$biomedata = $this->chunkInfo[$index][0];
if(strlen($biomedata) < 256) $biomedata = str_repeat("\x01", 256);
gzwrite($chunk, $biomedata);
for($Y = 0; $Y < $this->levelData["height"]; ++$Y){
if($this->chunks[$index][$Y] !== false and ((isset($this->chunkChange[$index][$Y]) and $this->chunkChange[$index][$Y] === 0) or !$this->isMiniChunkEmpty($X, $Z, $Y))){
gzwrite($chunk, $this->chunks[$index][$Y]);

View file

@ -447,6 +447,7 @@ class Level{
if(!isset($this->level)){
return false;
}
if(strlen($data) != 16384) console(strlen($data));
$this->changedCount[$X . ":" . $Y . ":" . $Z] = 4096;
if(ADVANCED_CACHE == true){
Cache::remove("world:{$this->name}:$X:$Z");