pocketmine\block\LapisOre::getDrops PHP Method

getDrops() public method

public getDrops ( Item $item ) : array
$item pocketmine\item\Item
return array
    public function getDrops(Item $item) : array
    {
        if ($item->isPickaxe() >= 3) {
            if ($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0) {
                return [[Item::LAPIS_ORE, 0, 1]];
            } else {
                $fortunel = $item->getEnchantmentLevel(Enchantment::TYPE_MINING_FORTUNE);
                $fortunel = $fortunel > 3 ? 3 : $fortunel;
                $times = [1, 1, 2, 3, 4];
                $time = $times[mt_rand(0, $fortunel + 1)];
                return [[Item::DYE, 4, mt_rand(4, 8) * $time]];
            }
        } else {
            return [];
        }
    }