diff --git a/src/pocketmine/Server.php b/src/pocketmine/Server.php index 4c10c30a4..9186fff93 100644 --- a/src/pocketmine/Server.php +++ b/src/pocketmine/Server.php @@ -1371,6 +1371,8 @@ class Server{ $this->logger->info("Advanced cache enabled"); } + Level::$COMPRESSION_LEVEL = $this->getProperty("chunk-sending.compression-level", 7); + if(defined("pocketmine\\DEBUG") and \pocketmine\DEBUG >= 0 and function_exists("cli_set_process_title")){ @cli_set_process_title("PocketMine-MP " . $this->getPocketMineVersion()); } diff --git a/src/pocketmine/level/Level.php b/src/pocketmine/level/Level.php index abeae5a1e..779604331 100644 --- a/src/pocketmine/level/Level.php +++ b/src/pocketmine/level/Level.php @@ -67,6 +67,7 @@ use raklib\Binary; class Level implements ChunkManager, Metadatable{ private static $levelIdCounter = 1; + public static $COMPRESSION_LEVEL = 7; const BLOCK_UPDATE_NORMAL = 1; @@ -1261,7 +1262,7 @@ class Level implements ChunkManager, Metadatable{ } } - $ordered = zlib_encode(Binary::writeLInt($X) . Binary::writeLInt($Z) . $orderedIds . $orderedData . $orderedSkyLight . $orderedLight . $biomeIds . $biomeColors, ZLIB_ENCODING_DEFLATE, 8); + $ordered = zlib_encode(Binary::writeLInt($X) . Binary::writeLInt($Z) . $orderedIds . $orderedData . $orderedSkyLight . $orderedLight . $biomeIds . $biomeColors, ZLIB_ENCODING_DEFLATE, self::$COMPRESSION_LEVEL); if(ADVANCED_CACHE == true and $Yndex === 0xff){ Cache::add($identifier, $ordered, 60);