diff --git a/src/constants/GeneralConstants.php b/src/constants/GeneralConstants.php index f459a0b0e3..2dc0bf1c4f 100644 --- a/src/constants/GeneralConstants.php +++ b/src/constants/GeneralConstants.php @@ -25,6 +25,9 @@ the Free Software Foundation, either version 3 of the License, or */ + +define("PMF_LEVEL_DEFLATE_LEVEL", 6); + //Gamemodes define("SURVIVAL", 0); define("CREATIVE", 1); diff --git a/src/pmf/Level.php b/src/pmf/Level.php index 13ab873264..bce72f4ac1 100644 --- a/src/pmf/Level.php +++ b/src/pmf/Level.php @@ -92,7 +92,7 @@ class PMFLevel extends PMF{ $this->write(Utils::writeFloat($this->levelData["spawnZ"])); $this->write(chr($this->levelData["width"])); $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->payloadOffset = ftell($this->fp); @@ -115,7 +115,7 @@ 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("", 9)); + @file_put_contents($this->getChunkPath($X, $Z), gzdeflate("", PMF_LEVEL_DEFLATE_LEVEL)); } if(!file_exists(dirname($this->file)."/entities.yml")){ $entities = new Config(dirname($this->file)."/entities.yml", CONFIG_YAML); @@ -384,7 +384,7 @@ class PMFLevel extends PMF{ return true; } - $chunk = @gzopen($this->getChunkPath($X, $Z), "wb9"); + $chunk = @gzopen($this->getChunkPath($X, $Z), "wb".PMF_LEVEL_DEFLATE_LEVEL); $bitmap = 0; 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))){