diff --git a/src/API/ServerAPI.php b/src/API/ServerAPI.php index 0053ba6f55..21e08e9f73 100644 --- a/src/API/ServerAPI.php +++ b/src/API/ServerAPI.php @@ -204,10 +204,10 @@ class ServerAPI{ } public function __destruct(){ - foreach($this->apiList as $ob){ - if(is_callable($ob, "__destruct")){ + foreach($this->apiList as $i => $ob){ + if(method_exists($ob, "__destruct")){ $ob->__destruct(); - unset($this->apiList[$ob]); + unset($this->apiList[$i]); } } } diff --git a/src/world/Level.php b/src/world/Level.php index 40b8086c8a..4e383a6ec1 100644 --- a/src/world/Level.php +++ b/src/world/Level.php @@ -128,7 +128,7 @@ class Level{ public function __destruct(){ if(isset($this->level)){ - $this->save(); + $this->save(false, false); $this->level->close(); unset($this->level); }