Added Redstone Ore block update

This commit is contained in:
Shoghi Cervantes Pueyo 2013-04-17 16:36:37 +02:00
parent d8bf5ce711
commit 2790f60491
4 changed files with 40 additions and 4 deletions

View file

@ -29,5 +29,25 @@ class GlowingRedstoneOreBlock extends SolidBlock{
public function __construct(){
parent::__construct(GLOWING_REDSTONE_ORE, 0, "Glowing Redstone Ore");
}
public function onUpdate(BlockAPI $level, $type){
if($type === BLOCK_UPDATE_SCHEDULED or $type === BLOCK_UPDATE_RANDOM){
$level->setBlock($this, REDSTONE_ORE, $this->getMetadata(), false);
return BLOCK_UPDATE_WEAK;
}else{
$level->scheduleBlockUpdate($this, mt_rand(45, 100));
}
return false;
}
public function getDrops(Item $item, Player $player){
if($item->isPickaxe() >= 2){
return array(
//array(331, 4, mt_rand(4, 5)),
);
}else{
return array();
}
}
}