mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-20 11:39:43 +00:00
fixed generation
This commit is contained in:
parent
dee0ea09fb
commit
8f1850f198
2 changed files with 12 additions and 3 deletions
|
|
@ -100,7 +100,13 @@ class PMFLevel extends PMF{
|
|||
$this->write(Utils::writeShort(0));
|
||||
$X = $Z = null;
|
||||
$this->getXZ($index, $X, $Z);
|
||||
@file_put_contents($this->getChunkPath($X, $Z), gzdeflate("", PMF_LEVEL_DEFLATE_LEVEL));
|
||||
|
||||
$chunk = @gzopen($this->getChunkPath($X, $Z), "wb" . PMF_LEVEL_DEFLATE_LEVEL);
|
||||
gzwrite($chunk, chr(self::CHUNK_VERSION));
|
||||
gzwrite($chunk, Utils::writeShort(0)); //heightmap
|
||||
gzwrite($chunk, "\x00"); //haslight
|
||||
gzwrite($chunk, "\x00"); //ticking
|
||||
gzclose($chunk);
|
||||
}
|
||||
if(!file_exists(dirname($this->file) . "/entities.yml")){
|
||||
$entities = new Config(dirname($this->file) . "/entities.yml", CONFIG_YAML);
|
||||
|
|
@ -183,6 +189,7 @@ class PMFLevel extends PMF{
|
|||
$index = self::getIndex($X, $Z);
|
||||
$o = ord($this->hasLight[$index]);
|
||||
$this->hasLight[$index] = chr($o | 1);
|
||||
$this->chunkChange[$index][-1] = true;
|
||||
return true;
|
||||
}
|
||||
public function markHasSkylight($X, $Z){
|
||||
|
|
@ -190,6 +197,7 @@ class PMFLevel extends PMF{
|
|||
$index = self::getIndex($X, $Z);
|
||||
$o = ord($this->hasLight[$index]);
|
||||
$this->hasLight[$index] = chr($o | 2);
|
||||
$this->chunkChange[$index][-1] = true;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
@ -541,7 +549,7 @@ class PMFLevel extends PMF{
|
|||
if($this->isChunkLoaded($X, $Z) === false){
|
||||
$this->loadChunk($X, $Z);
|
||||
}
|
||||
if(strlen($data) !== 8192){
|
||||
if(strlen($data) !== 10240){
|
||||
return false;
|
||||
}
|
||||
$index = self::getIndex($X, $Z);
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@ class TemporalGenerator implements LevelGenerator{
|
|||
for($Y = 0; $Y < 8; ++$Y){
|
||||
$chunk[$Y] .= substr($block, $Y << 4, 16);
|
||||
$chunk[$Y] .= substr($meta, $Y << 3, 8);
|
||||
$chunk[$Y] .= "\x00\x00\x00\x00\x00\x00\x00\x00";
|
||||
$chunk[$Y] .= "\x00\x00\x00\x00\x00\x00\x00\x00"; //blocklight
|
||||
$chunk[$Y] .= "\x00\x00\x00\x00\x00\x00\x00\x00"; //skylight
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue