mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-07 04:17:07 +00:00
Improved event checking on PlayerInteractEvent
This commit is contained in:
parent
45dbb3f828
commit
f9d5c5bd37
@ -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){
|
||||||
|
Loading…
x
Reference in New Issue
Block a user