From 41084f51a662767195f52ac397776db7c3e58ce3 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Tue, 27 Aug 2013 14:03:48 +0200 Subject: [PATCH] Removed double chests --- src/material/block/solid/Chest.php | 4 +++- src/world/LevelImport.php | 5 ++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/material/block/solid/Chest.php b/src/material/block/solid/Chest.php index 1531e9d9..ecf800ee 100644 --- a/src/material/block/solid/Chest.php +++ b/src/material/block/solid/Chest.php @@ -65,10 +65,12 @@ class ChestBlock extends TransparentBlock{ "y" => $this->y, "z" => $this->z )); + + /* 0.7.4 bug, waiting for Mojang... if($chest instanceof Tile){ $chest->pairWith($tile); $tile->pairWith($chest); - } + }*/ return true; } diff --git a/src/world/LevelImport.php b/src/world/LevelImport.php index 787814a7..5e0d5b6c 100644 --- a/src/world/LevelImport.php +++ b/src/world/LevelImport.php @@ -41,15 +41,14 @@ class LevelImport{ $tiles->save(); }elseif(file_exists($this->path."chunks.dat") and file_exists($this->path."level.dat")){ //Pocket $nbt = new NBT(); - $nbt->load(substr(file_get_contents($this->path."level.dat"), 12)); + $nbt->load(substr(file_get_contents($this->path."level.dat"), 8)); $level = array_shift($nbt->tree); - var_dump($level); if($level["LevelName"] == ""){ $level["LevelName"] = "world".time(); } console("[INFO] Importing Pocket level \"".$level["LevelName"]."\" to PMF format"); unset($level["Player"]); - $nbt->load(file_get_contents($this->path."entities.dat")); + $nbt->load(substr(file_get_contents($this->path."entities.dat"), 12)); $entities = array_shift($nbt->tree); if(!isset($entities["TileEntities"])){ $entities["TileEntities"] = array();