mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-08 19:02:59 +00:00
Added Block and Item namespaces
This commit is contained in:
@ -19,7 +19,10 @@
|
||||
*
|
||||
*/
|
||||
|
||||
class GlowingRedstoneOreBlock extends SolidBlock{
|
||||
namespace PocketMine\Block;
|
||||
use PocketMine;
|
||||
|
||||
class GlowingRedstoneOre extends Solid{
|
||||
public function __construct(){
|
||||
parent::__construct(GLOWING_REDSTONE_ORE, 0, "Glowing Redstone Ore");
|
||||
$this->hardness = 15;
|
||||
@ -27,18 +30,18 @@ class GlowingRedstoneOreBlock extends SolidBlock{
|
||||
|
||||
public function onUpdate($type){
|
||||
if($type === BLOCK_UPDATE_SCHEDULED or $type === BLOCK_UPDATE_RANDOM){
|
||||
$this->level->setBlock($this, Block\Block::get(REDSTONE_ORE, $this->meta), false, false, true);
|
||||
$this->level->setBlock($this, Block::get(REDSTONE_ORE, $this->meta), false, false, true);
|
||||
|
||||
return BLOCK_UPDATE_WEAK;
|
||||
} else{
|
||||
$this->level->scheduleBlockUpdate(new Position($this, 0, 0, $this->level), Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
||||
$this->level->scheduleBlockUpdate(new Level\Position($this, 0, 0, $this->level), Utils\Utils::getRandomUpdateTicks(), BLOCK_UPDATE_RANDOM);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public function getBreakTime(Item $item, Player $player){
|
||||
public function getBreakTime(Item\Item $item, Player $player){
|
||||
if(($player->gamemode & 0x01) === 0x01){
|
||||
return 0.20;
|
||||
}
|
||||
@ -52,10 +55,10 @@ class GlowingRedstoneOreBlock extends SolidBlock{
|
||||
}
|
||||
}
|
||||
|
||||
public function getDrops(Item $item, Player $player){
|
||||
public function getDrops(Item\Item $item, Player $player){
|
||||
if($item->isPickaxe() >= 4){
|
||||
return array(
|
||||
array(REDSTONE_DUST, 0, mt_rand(4, 5)),
|
||||
array(Item\REDSTONE_DUST, 0, mt_rand(4, 5)),
|
||||
);
|
||||
} else{
|
||||
return array();
|
||||
|
Reference in New Issue
Block a user