Update Glass.php
This commit is contained in:
parent
fa5eee2a36
commit
aa726061f7
1 changed files with 21 additions and 6 deletions
|
|
@ -22,24 +22,39 @@
|
|||
namespace pocketmine\block;
|
||||
|
||||
use pocketmine\item\Item;
|
||||
use pocketmine\item\Tool;
|
||||
use pocketmine\item\enchantment\enchantment;
|
||||
|
||||
class Glass extends Transparent{
|
||||
class Melon extends Transparent{
|
||||
|
||||
protected $id = self::GLASS;
|
||||
protected $id = self::MELON_BLOCK;
|
||||
|
||||
public function __construct(){
|
||||
|
||||
}
|
||||
|
||||
public function getName() : string{
|
||||
return "Glass";
|
||||
return "Melon Block";
|
||||
}
|
||||
|
||||
public function getHardness() {
|
||||
return 0.3;
|
||||
return 1;
|
||||
}
|
||||
|
||||
public function getToolType(){
|
||||
return Tool::TYPE_AXE;
|
||||
}
|
||||
|
||||
public function getDrops(Item $item) : array {
|
||||
return [];
|
||||
if($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0){
|
||||
return [
|
||||
[Item::MELON_BLOCK, 0, 1],
|
||||
];
|
||||
}else{
|
||||
return [
|
||||
[Item::MELON_SLICE, 0, mt_rand(3, 7)],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue