item = $item; $this->player = $player; $this->instaBreak = $instaBreak; $this->setDrops($drops); } /** * Returns the player who is destroying the block. * @return Player */ public function getPlayer() : Player{ return $this->player; } /** * Returns the item used to destroy the block. * @return Item */ public function getItem() : Item{ return $this->item; } /** * Returns whether the block may be broken in less than the amount of time calculated. This is usually true for * creative players. * * @return bool */ public function getInstaBreak() : bool{ return $this->instaBreak; } /** * @param bool $instaBreak */ public function setInstaBreak(bool $instaBreak){ $this->instaBreak = $instaBreak; } /** * @return Item[] */ public function getDrops() : array{ return $this->blockDrops; } /** * @param Item[] $drops */ public function setDrops(array $drops){ $this->setDropsVariadic(...$drops); } /** * Variadic hack for easy array member type enforcement. * * @param Item ...$drops */ public function setDropsVariadic(Item ...$drops){ $this->blockDrops = $drops; } }