Update LapisOre.php

This commit is contained in:
dog194 2016-04-14 01:55:30 +08:00
commit ed8f962752

View file

@ -23,6 +23,7 @@ namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\item\enchantment\enchantment;
class LapisOre extends Solid{
@ -46,12 +47,18 @@ class LapisOre extends Solid{
public function getDrops(Item $item) : array {
if($item->isPickaxe() >= 3){
return [
[Item::DYE, 4, mt_rand(4, 8)],
];
if($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0){
return [
[Item::LAPIS_ORE, 0, 1],
];
}else{
return [
[Item::DYE, 4, mt_rand(4, 8)],
];
}
}else{
return [];
}
}
}
}