Fixed chests

This commit is contained in:
Shoghi Cervantes 2013-08-27 13:48:08 +02:00
parent d61f7b889f
commit 1055ab6a79

View File

@ -41,14 +41,15 @@ class LevelImport{
$tiles->save(); $tiles->save();
}elseif(file_exists($this->path."chunks.dat") and file_exists($this->path."level.dat")){ //Pocket }elseif(file_exists($this->path."chunks.dat") and file_exists($this->path."level.dat")){ //Pocket
$nbt = new NBT(); $nbt = new NBT();
$nbt->load(file_get_contents($this->path."level.dat")); $nbt->load(substr(file_get_contents($this->path."level.dat"), 12));
$level = array_shift($nbt->tree); $level = array_shift($nbt->tree);
var_dump($level);
if($level["LevelName"] == ""){ if($level["LevelName"] == ""){
$level["LevelName"] = "world".time(); $level["LevelName"] = "world".time();
} }
console("[INFO] Importing Pocket level \"".$level["LevelName"]."\" to PMF format"); console("[INFO] Importing Pocket level \"".$level["LevelName"]."\" to PMF format");
unset($level["Player"]); unset($level["Player"]);
$nbt->load(substr(file_get_contents($this->path."entities.dat"), 12)); $nbt->load(file_get_contents($this->path."entities.dat"));
$entities = array_shift($nbt->tree); $entities = array_shift($nbt->tree);
if(!isset($entities["TileEntities"])){ if(!isset($entities["TileEntities"])){
$entities["TileEntities"] = array(); $entities["TileEntities"] = array();