mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 06:25:32 +00:00
Remove impossible uses of PlayerInteractEvent CLICK_AIR constants
This commit is contained in:
parent
06c4f31db7
commit
bfbc845efa
@ -2698,7 +2698,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
|
|
||||||
$target = $this->level->getBlock($pos);
|
$target = $this->level->getBlock($pos);
|
||||||
|
|
||||||
$ev = new PlayerInteractEvent($this, $this->inventory->getItemInHand(), $target, null, $packet->face, $target->getId() === 0 ? PlayerInteractEvent::LEFT_CLICK_AIR : PlayerInteractEvent::LEFT_CLICK_BLOCK);
|
$ev = new PlayerInteractEvent($this, $this->inventory->getItemInHand(), $target, null, $packet->face, PlayerInteractEvent::LEFT_CLICK_BLOCK);
|
||||||
if($this->level->checkSpawnProtection($this, $target)){
|
if($this->level->checkSpawnProtection($this, $target)){
|
||||||
$ev->setCancelled();
|
$ev->setCancelled();
|
||||||
}
|
}
|
||||||
|
@ -1778,7 +1778,7 @@ class Level implements ChunkManager, Metadatable{
|
|||||||
}
|
}
|
||||||
|
|
||||||
if($player !== null){
|
if($player !== null){
|
||||||
$ev = new PlayerInteractEvent($player, $item, $blockClicked, $clickVector, $face, $blockClicked->getId() === 0 ? PlayerInteractEvent::RIGHT_CLICK_AIR : PlayerInteractEvent::RIGHT_CLICK_BLOCK);
|
$ev = new PlayerInteractEvent($player, $item, $blockClicked, $clickVector, $face, PlayerInteractEvent::RIGHT_CLICK_BLOCK);
|
||||||
if($this->checkSpawnProtection($player, $blockClicked)){
|
if($this->checkSpawnProtection($player, $blockClicked)){
|
||||||
$ev->setCancelled(); //set it to cancelled so plugins can bypass this
|
$ev->setCancelled(); //set it to cancelled so plugins can bypass this
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user