Update Glass.php

This commit is contained in:
dog194 2016-04-14 10:40:04 +08:00
commit aa726061f7

View file

@ -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)],
];
}
}
}
}