mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-15 16:05:28 +00:00
parent
822af4f7f5
commit
6673289c33
@ -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;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user