Typehinted block events API

This commit is contained in:
Dylan K. Taylor
2017-06-27 09:34:15 +01:00
parent 64f2e7587d
commit 276fccf4bb
7 changed files with 84 additions and 28 deletions

View File

@ -40,36 +40,46 @@ class BlockPlaceEvent extends BlockEvent implements Cancellable{
/** @var Item */
protected $item;
/** @var Block */
protected $blockReplace;
/** @var Block */
protected $blockAgainst;
public function __construct(Player $player, Block $blockPlace, Block $blockReplace, Block $blockAgainst, Item $item){
$this->block = $blockPlace;
parent::__construct($blockPlace);
$this->blockReplace = $blockReplace;
$this->blockAgainst = $blockAgainst;
$this->item = $item;
$this->player = $player;
}
public function getPlayer(){
/**
* Returns the player who is placing the block.
* @return Player
*/
public function getPlayer() : Player{
return $this->player;
}
/**
* Gets the item in hand
*
* @return mixed
* @return Item
*/
public function getItem(){
public function getItem() : Item{
return $this->item;
}
public function getBlockReplaced(){
/**
* @return Block
*/
public function getBlockReplaced() : Block{
return $this->blockReplace;
}
public function getBlockAgainst(){
/**
* @return Block
*/
public function getBlockAgainst() : Block{
return $this->blockAgainst;
}
}