※Update for SILK TOUCH
Stone
This commit is contained in:
parent
7ed1636b4f
commit
7a84f0a6b9
1 changed files with 6 additions and 0 deletions
|
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\Tool;
|
||||
use pocketmine\item\enchantment\enchantment;
|
||||
|
||||
class Stone extends Solid{
|
||||
const NORMAL = 0;
|
||||
|
|
@ -64,6 +65,11 @@ class Stone extends Solid{
|
|||
|
||||
public function getDrops(Item $item) : array {
|
||||
if($item->isPickaxe() >= Tool::TIER_WOODEN){
|
||||
if($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0 and $this->getDamage() === 0){
|
||||
return [
|
||||
[Item::STONE, 0, 1],
|
||||
];
|
||||
}
|
||||
return [
|
||||
[$this->getDamage() === 0 ? Item::COBBLESTONE : Item::STONE, $this->getDamage(), 1],
|
||||
];
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue