From 13bfaaf7b895e73da1a2a130d74183973e651a87 Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Date: Sat, 8 Jun 2013 01:50:03 +0200 Subject: [PATCH] Fixed crash after level unload --- src/API/BlockAPI.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index 5645fd804..cba00ef61 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -741,6 +741,10 @@ class BlockAPI{ $pos = new Position($pos->x, $pos->y, $pos->z, $pos->level); $block = $pos->level->getBlock($pos); } + if($block === false){ + return false; + } + $level = $block->onUpdate($type); if($level === BLOCK_UPDATE_NORMAL){ $this->blockUpdateAround($block, $level);