mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-16 18:59:00 +00:00
Fixed NBT compression, Anvil generated worlds are readable by Minecraft and other tools
This commit is contained in:
parent
f073a5b837
commit
85007a9dfe
@ -160,7 +160,7 @@ class RegionLoader{
|
||||
$writer = new NBT(NBT::BIG_ENDIAN);
|
||||
$nbt->setName("Level");
|
||||
$writer->setData(new Compound("", array("Level" => $nbt)));
|
||||
$chunkData = $writer->writeCompressed(self::COMPRESSION_ZLIB, self::$COMPRESSION_LEVEL);
|
||||
$chunkData = $writer->writeCompressed(ZLIB_ENCODING_DEFLATE, self::$COMPRESSION_LEVEL);
|
||||
$length = strlen($chunkData) + 1;
|
||||
$sectors = (int) ceil(($length + 4) / 4096);
|
||||
$index = self::getChunkOffset($x, $z);
|
||||
|
@ -121,7 +121,7 @@ class NBT{
|
||||
|
||||
public function writeCompressed($compression = ZLIB_ENCODING_GZIP, $level = 7){
|
||||
if(($write = $this->write()) !== false){
|
||||
return zlib_encode($write, ZLIB_ENCODING_GZIP, $level);
|
||||
return zlib_encode($write, $compression, $level);
|
||||
}
|
||||
|
||||
return false;
|
||||
|
Loading…
x
Reference in New Issue
Block a user