pocketmine\event\block\BlockBreakEvent::__construct PHP Метод

__construct() публичный Метод

public __construct ( Player $player, Block $block, Item $item, $instaBreak = false )
$player pocketmine\Player
$block pocketmine\block\Block
$item pocketmine\item\Item
    public function __construct(Player $player, Block $block, Item $item, $instaBreak = false)
    {
        $this->block = $block;
        $this->item = $item;
        $this->player = $player;
        $this->instaBreak = (bool) $instaBreak;
        $drops = $player->isSurvival() ? $block->getDrops($item) : [];
        if ($drops != null && is_numeric($drops[0])) {
            $this->blockDrops[] = Item::get($drops[0], $drops[1], $drops[2]);
        } else {
            foreach ($drops as $i) {
                $this->blockDrops[] = Item::get($i[0], $i[1], $i[2]);
            }
        }
    }