Update BrownMushroomBlock.php

This commit is contained in:
dog194 2016-04-14 12:18:34 +08:00
commit 11358d3235

View file

@ -8,12 +8,11 @@ use pocketmine\item\Tool;
use pocketmine\item\enchantment\enchantment;
use pocketmine\Player;
class RedMushroomBlock extends Solid{
class BrownMushroomBlock extends Solid{
const BROWN = 14;
const RED = 14;
const STEM = 10;
protected $id = self::RED_MUSHROOM_BLOCK;
protected $id = self::BROWN_MUSHROOM_BLOCK;
public function __construct($meta = 15){
$this->meta = $meta;
@ -32,17 +31,17 @@ class RedMushroomBlock extends Solid{
}
public function getName() : string{
return "Red Mushroom Block";
return "Brown Mushroom Block";
}
public function getDrops(Item $item) : array {
if($item->getEnchantmentLevel(Enchantment::TYPE_MINING_SILK_TOUCH) > 0){
return [
[Item::RED_MUSHROOM_BLOCK, SELF::RED, 1],
[Item::BROWN_MUSHROOM_BLOCK, SELF::BROWN, 1],
];
}else{
return [
[Item::RED_MUSHROOM, 0, mt_rand(0, 2)],
[Item::BROWN_MUSHROOM, 0, mt_rand(0, 2)],
];
}
}