diff --git a/src/API/LevelAPI.php b/src/API/LevelAPI.php index 1204f5b6d..e979cd6da 100644 --- a/src/API/LevelAPI.php +++ b/src/API/LevelAPI.php @@ -205,7 +205,7 @@ class LevelAPI{ $tag = new NBTTag_List("Items", array()); $tag->setTagType(NBTTag::TAG_Compound); foreach($data as $slot => $fields){ - $tag->{$slot} = new NBTTag_Compound(false, array( + $tag[(int) $slot] = new NBTTag_Compound(false, array( "Count" => new NBTTag_Byte("Count", $fields["Count"]), "Slot" => new NBTTag_Short("Slot", $fields["Slot"]), "Damage" => new NBTTag_Short("Damage", $fields["Damage"]), diff --git a/src/world/Level.php b/src/world/Level.php index 03b057b94..639e0dc25 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -405,9 +405,6 @@ class Level{ public function loadChunk($X, $Z){ - if(!isset($this->level)){ - return false; - } $index = PMFLevel::getIndex($X, $Z); if(isset($this->usedChunks[$index])){ return true; @@ -433,6 +430,7 @@ class Level{ break; } } + return true; } return false; }