Update Ice.php
This commit is contained in:
parent
771f3fe216
commit
b086993f03
1 changed files with 12 additions and 4 deletions
|
|
@ -23,6 +23,7 @@ namespace pocketmine\block;
|
|||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\Tool;
|
||||
use pocketmine\item\enchantment\enchantment;
|
||||
|
||||
class Ice extends Transparent{
|
||||
|
||||
|
|
@ -45,12 +46,19 @@ class Ice extends Transparent{
|
|||
}
|
||||
|
||||
public function onBreak(Item $item){
|
||||
$this->getLevel()->setBlock($this, new Water(), true);
|
||||
|
||||
if($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) === 0){
|
||||
$this->getLevel()->setBlock($this, new Water(), true);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public function getDrops(Item $item) : array {
|
||||
return [];
|
||||
if($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0){
|
||||
return [
|
||||
[Item::ICE, 0, 1],
|
||||
];
|
||||
}else{
|
||||
return [];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue