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:
Dylan K. Taylor 2018-08-05 19:07:23 +01:00
parent 6fcb221453
commit c90e3e351d
2 changed files with 1 additions and 5 deletions

View File

@ -2155,7 +2155,7 @@ class Player extends Human implements CommandSender, ChunkLoader, IPlayer{
$this->server->getPluginManager()->callEvent($ev);
if(!$ev->isCancelled()){
$this->inventory->setItemInHand($ev->getResultItem());
$this->inventory->setItemInHand($item);
}
return true;

View File

@ -50,8 +50,4 @@ class PlayerBlockPickEvent extends PlayerEvent implements Cancellable{
public function getResultItem() : Item{
return $this->resultItem;
}
public function setResultItem(Item $item) : void{
$this->resultItem = clone $item;
}
}