mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-14 15:35:31 +00:00
Added PMF_LEVEL_DEFLATE_LEVEL
This commit is contained in:
parent
13bfaaf7b8
commit
8bef816061
@ -25,6 +25,9 @@ the Free Software Foundation, either version 3 of the License, or
|
|||||||
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
define("PMF_LEVEL_DEFLATE_LEVEL", 6);
|
||||||
|
|
||||||
//Gamemodes
|
//Gamemodes
|
||||||
define("SURVIVAL", 0);
|
define("SURVIVAL", 0);
|
||||||
define("CREATIVE", 1);
|
define("CREATIVE", 1);
|
||||||
|
@ -92,7 +92,7 @@ class PMFLevel extends PMF{
|
|||||||
$this->write(Utils::writeFloat($this->levelData["spawnZ"]));
|
$this->write(Utils::writeFloat($this->levelData["spawnZ"]));
|
||||||
$this->write(chr($this->levelData["width"]));
|
$this->write(chr($this->levelData["width"]));
|
||||||
$this->write(chr($this->levelData["height"]));
|
$this->write(chr($this->levelData["height"]));
|
||||||
$extra = gzdeflate($this->levelData["extra"], 9);
|
$extra = gzdeflate($this->levelData["extra"], PMF_LEVEL_DEFLATE_LEVEL);
|
||||||
$this->write(Utils::writeShort(strlen($extra)).$extra);
|
$this->write(Utils::writeShort(strlen($extra)).$extra);
|
||||||
$this->payloadOffset = ftell($this->fp);
|
$this->payloadOffset = ftell($this->fp);
|
||||||
|
|
||||||
@ -115,7 +115,7 @@ class PMFLevel extends PMF{
|
|||||||
$this->write(Utils::writeShort(0));
|
$this->write(Utils::writeShort(0));
|
||||||
$X = $Z = null;
|
$X = $Z = null;
|
||||||
$this->getXZ($index, $X, $Z);
|
$this->getXZ($index, $X, $Z);
|
||||||
@file_put_contents($this->getChunkPath($X, $Z), gzdeflate("", 9));
|
@file_put_contents($this->getChunkPath($X, $Z), gzdeflate("", PMF_LEVEL_DEFLATE_LEVEL));
|
||||||
}
|
}
|
||||||
if(!file_exists(dirname($this->file)."/entities.yml")){
|
if(!file_exists(dirname($this->file)."/entities.yml")){
|
||||||
$entities = new Config(dirname($this->file)."/entities.yml", CONFIG_YAML);
|
$entities = new Config(dirname($this->file)."/entities.yml", CONFIG_YAML);
|
||||||
@ -384,7 +384,7 @@ class PMFLevel extends PMF{
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
$chunk = @gzopen($this->getChunkPath($X, $Z), "wb9");
|
$chunk = @gzopen($this->getChunkPath($X, $Z), "wb".PMF_LEVEL_DEFLATE_LEVEL);
|
||||||
$bitmap = 0;
|
$bitmap = 0;
|
||||||
for($Y = 0; $Y < $this->levelData["height"]; ++$Y){
|
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))){
|
if($this->chunks[$index][$Y] !== false and ((isset($this->chunkChange[$index][$Y]) and $this->chunkChange[$index][$Y] === 0) or !$this->isMiniChunkEmpty($X, $Z, $Y))){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user