added use-item click vector to PlayerInteractEvent

now go and make some touchscreens with maps!
This commit is contained in:
Dylan K. Taylor
2017-10-27 19:00:17 +01:00
parent 747477dfcf
commit c55bc2d7e9
3 changed files with 16 additions and 12 deletions

View File

@ -1746,7 +1746,7 @@ class Level implements ChunkManager, Metadatable{
}
if($player !== null){
$ev = new PlayerInteractEvent($player, $item, $blockClicked, $face, $blockClicked->getId() === 0 ? PlayerInteractEvent::RIGHT_CLICK_AIR : PlayerInteractEvent::RIGHT_CLICK_BLOCK);
$ev = new PlayerInteractEvent($player, $item, $blockClicked, $facePos, $face, $blockClicked->getId() === 0 ? PlayerInteractEvent::RIGHT_CLICK_AIR : PlayerInteractEvent::RIGHT_CLICK_BLOCK);
if($this->checkSpawnProtection($player, $blockClicked)){
$ev->setCancelled(); //set it to cancelled so plugins can bypass this
}