mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-15 18:29:46 +00:00
PlayerInteractEvent: cleanup constructor now that block isn't optional anymore
This commit is contained in:
parent
db2567f965
commit
0e5cbca983
@ -61,11 +61,10 @@ class PlayerInteractEvent extends PlayerEvent implements Cancellable{
|
|||||||
* @param int $face
|
* @param int $face
|
||||||
* @param int $action
|
* @param int $action
|
||||||
*/
|
*/
|
||||||
public function __construct(Player $player, Item $item, ?Block $block, ?Vector3 $touchVector, int $face, int $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK){
|
public function __construct(Player $player, Item $item, Block $block, ?Vector3 $touchVector, int $face, int $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK){
|
||||||
assert($block !== null or $touchVector !== null);
|
|
||||||
$this->player = $player;
|
$this->player = $player;
|
||||||
$this->item = $item;
|
$this->item = $item;
|
||||||
$this->blockTouched = $block ?? BlockFactory::get(0, 0, new Position(0, 0, 0, $player->level));
|
$this->blockTouched = $block;
|
||||||
$this->touchVector = $touchVector ?? new Vector3(0, 0, 0);
|
$this->touchVector = $touchVector ?? new Vector3(0, 0, 0);
|
||||||
$this->blockFace = $face;
|
$this->blockFace = $face;
|
||||||
$this->action = $action;
|
$this->action = $action;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user