mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 12:09:43 +00:00
fixed oldmcpe->pmf2
This commit is contained in:
parent
6f68baf7e2
commit
ad8cbb81ff
1 changed files with 8 additions and 3 deletions
|
|
@ -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";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue