Fixed #39 placing blocks inside an entity

This commit is contained in:
Shoghi Cervantes Pueyo
2013-01-12 16:47:12 +01:00
parent 4bda101ab8
commit e4d71949e3
3 changed files with 21 additions and 4 deletions

View File

@@ -391,8 +391,16 @@ class BlockAPI{
}else{
return $this->cancelAction($block);
}
$entity = $this->server->api->entity->get($data["eid"]);
if(($entity instanceof Entity) !== true){
return $this->cancelAction($block); //No Entity WTF?
}
if($entity->inBlock($block[2][0], $block[2][1], $block[2][2])){
return $this->cancelAction($block); //Entity in block
}
$direction = $this->server->api->entity->get($data["eid"])->getDirection();
$direction = $entity->getDirection();
switch($data["block"]){
case 6: