mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 09:49:50 +00:00
PlayerBlockPickEvent: remove setResultItem()
the same behaviour can be achieved by cancelling the event and setting the held item manually. Allowing this to be changed increases the complexity of dealing with survival block picking.
This commit is contained in:
parent
6fcb221453
commit
c90e3e351d
@ -2155,7 +2155,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
|
|||||||
|
|
||||||
$this->server->getPluginManager()->callEvent($ev);
|
$this->server->getPluginManager()->callEvent($ev);
|
||||||
if(!$ev->isCancelled()){
|
if(!$ev->isCancelled()){
|
||||||
$this->inventory->setItemInHand($ev->getResultItem());
|
$this->inventory->setItemInHand($item);
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
@ -50,8 +50,4 @@ class PlayerBlockPickEvent extends PlayerEvent implements Cancellable{
|
|||||||
public function getResultItem() : Item{
|
public function getResultItem() : Item{
|
||||||
return $this->resultItem;
|
return $this->resultItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setResultItem(Item $item) : void{
|
|
||||||
$this->resultItem = clone $item;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user