This commit is contained in:
PEMapModder 2016-03-28 02:42:08 +08:00
parent 8441169365
commit aade3fe390
2 changed files with 4 additions and 30 deletions

View File

@ -22,51 +22,27 @@
namespace pocketmine\block;
use pocketmine\item\Item;
use pocketmine\item\Tool;
use pocketmine\level\Level;
class GlowingRedstoneOre extends Solid{
class GlowingRedstoneOre extends RedstoneOre{
protected $id = self::GLOWING_REDSTONE_ORE;
public function __construct(){
}
public function getHardness(){
return 15;
}
public function getName(){
return "Glowing Redstone Ore";
}
public function getToolType(){
return Tool::TYPE_PICKAXE;
}
public function getLightLevel(){
return 9;
}
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_SCHEDULED or $type === Level::BLOCK_UPDATE_RANDOM){
$this->getLevel()->setBlock($this, Block::get(Item::REDSTONE_ORE, $this->meta), false, false, true);
$this->getLevel()->setBlock($this, Block::get(Item::REDSTONE_ORE, $this->meta), false, false);
return Level::BLOCK_UPDATE_WEAK;
}
return false;
}
public function getDrops(Item $item){
if($item->isPickaxe() >= Tool::TIER_IRON){
return [
[Item::REDSTONE_DUST, 0, mt_rand(4, 5)],
];
}else{
return [];
}
}
}

View File

@ -43,7 +43,7 @@ class RedstoneOre extends Solid{
public function onUpdate($type){
if($type === Level::BLOCK_UPDATE_NORMAL or $type === Level::BLOCK_UPDATE_TOUCH){
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta), false, true);
$this->getLevel()->setBlock($this, Block::get(Item::GLOWING_REDSTONE_ORE, $this->meta));
return Level::BLOCK_UPDATE_WEAK;
}
@ -51,14 +51,12 @@ class RedstoneOre extends Solid{
return false;
}
public function getToolType(){
return Tool::TYPE_PICKAXE;
}
public function getDrops(Item $item){
if($item->isPickaxe() >= Tool::TIER_GOLD){
if($item->isPickaxe() >= Tool::TIER_IRON){
return [
[Item::REDSTONE_DUST, 0, mt_rand(4, 5)],
];