Fix for placing blocks where no block exists

This commit is contained in:
Shoghi Cervantes Pueyo 2012-12-29 14:13:20 +01:00
parent 000ba5de52
commit 29a5041ef1

View File

@ -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]){