From 29a5041ef1124a80eae2fe2b4381693f6d3a469e Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sat, 29 Dec 2012 14:13:20 +0100 Subject: [PATCH] Fix for placing blocks where no block exists --- src/API/BlockAPI.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/API/BlockAPI.php b/src/API/BlockAPI.php index f6122858..7242184d 100644 --- a/src/API/BlockAPI.php +++ b/src/API/BlockAPI.php @@ -183,6 +183,12 @@ class BlockAPI{ return false; } $target = $this->server->api->level->getBlock($data["x"], $data["y"], $data["z"]); + if($target[0] === 0){ //If no block exists + $this->cancelAction($target); + $block = $this->server->api->level->getBlockFace($target, $data["face"]); + return $this->cancelAction($block); + } + $cancelPlace = false; if(isset(Material::$activable[$target[0]])){ switch($target[0]){