Improved event checking on PlayerInteractEvent

This commit is contained in:
Shoghi Cervantes 2014-09-16 17:49:44 +02:00
parent 45dbb3f828
commit f9d5c5bd37

View File

@ -1099,13 +1099,13 @@ class Level implements ChunkManager, Metadatable{
if($target->isActivable === true and $target->onActivate($item, $player) === true){ if($target->isActivable === true and $target->onActivate($item, $player) === true){
return true; return true;
} }
}
if($item->isActivable and $item->onActivate($this, $player, $block, $target, $face, $fx, $fy, $fz)){ if($item->isActivable and $item->onActivate($this, $player, $block, $target, $face, $fx, $fy, $fz)){
if($item->getCount() <= 0){ if($item->getCount() <= 0){
$item = Item::get(Item::AIR, 0, 0); $item = Item::get(Item::AIR, 0, 0);
return true; return true;
}
} }
} }
}elseif($target->isActivable === true and $target->onActivate($item, $player) === true){ }elseif($target->isActivable === true and $target->onActivate($item, $player) === true){