From 0e5cbca9834908f980a2c42ea12329caa939b837 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Fri, 14 Sep 2018 16:30:22 +0100 Subject: [PATCH] PlayerInteractEvent: cleanup constructor now that block isn't optional anymore --- src/pocketmine/event/player/PlayerInteractEvent.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/pocketmine/event/player/PlayerInteractEvent.php b/src/pocketmine/event/player/PlayerInteractEvent.php index 7ca0e59ac..04f7cd229 100644 --- a/src/pocketmine/event/player/PlayerInteractEvent.php +++ b/src/pocketmine/event/player/PlayerInteractEvent.php @@ -61,11 +61,10 @@ class PlayerInteractEvent extends PlayerEvent implements Cancellable{ * @param int $face * @param int $action */ - 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); + public function __construct(Player $player, Item $item, Block $block, ?Vector3 $touchVector, int $face, int $action = PlayerInteractEvent::RIGHT_CLICK_BLOCK){ $this->player = $player; $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->blockFace = $face; $this->action = $action;