mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 10:53:05 +00:00
@ -46,6 +46,9 @@ class DropItemAction extends InventoryAction{
|
|||||||
|
|
||||||
public function onPreExecute(Player $source) : bool{
|
public function onPreExecute(Player $source) : bool{
|
||||||
$ev = new PlayerDropItemEvent($source, $this->targetItem);
|
$ev = new PlayerDropItemEvent($source, $this->targetItem);
|
||||||
|
if($source->isSpectator()){
|
||||||
|
$ev->cancel();
|
||||||
|
}
|
||||||
$ev->call();
|
$ev->call();
|
||||||
if($ev->isCancelled()){
|
if($ev->isCancelled()){
|
||||||
return false;
|
return false;
|
||||||
|
Reference in New Issue
Block a user