diff --git a/src/world/LevelImport.php b/src/world/LevelImport.php index 49f21773..a0677b92 100644 --- a/src/world/LevelImport.php +++ b/src/world/LevelImport.php @@ -49,7 +49,8 @@ class LevelImport{ "spawnZ" => $level["SpawnZ"], "extra" => "", "width" => 16, - "height" => 8 + "height" => 8, + "generator" => get_class(LevelAPI::createGenerator(LevelAPI::$defaultLevelType)) ]); $chunks = new PocketChunkParser(); $chunks->loadFile($this->path . "chunks.dat"); @@ -72,8 +73,12 @@ class LevelImport{ $meta = $chunks->getChunkColumn($X, $Z, $x, $z, 1); 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"; + $metaf = str_split(substr($meta, $Y << 3, 8)); + foreach($metaf as $m2){ + $chunk[$Y] .= chr(ord($m2) << 4) . chr(ord($m2) & 0xf); + } + $chunk[$Y] .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; + $chunk[$Y] .= "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00"; } } }