lit ? self::GLOWING_REDSTONE_ORE : self::REDSTONE_ORE; } public function getName() : string{ return "Redstone Ore"; } public function getHardness() : float{ return 3; } public function isLit() : bool{ return $this->lit; } public function setLit(bool $lit = true) : void{ $this->lit = $lit; } public function getLightLevel() : int{ return $this->lit ? 9 : 0; } public function place(Item $item, Block $blockReplace, Block $blockClicked, int $face, Vector3 $clickVector, Player $player = null) : bool{ return $this->getLevel()->setBlock($this, $this, false); } public function onActivate(Item $item, Player $player = null) : bool{ if(!$this->lit){ $this->lit = true; $this->getLevel()->setBlock($this, $this); //no return here - this shouldn't prevent block placement } return false; } public function onNearbyBlockChange() : void{ if(!$this->lit){ $this->lit = true; $this->getLevel()->setBlock($this, $this); } } public function ticksRandomly() : bool{ return true; } public function onRandomTick() : void{ if($this->lit){ $this->lit = false; $this->level->setBlock($this, $this); } } public function getToolType() : int{ return BlockToolType::TYPE_PICKAXE; } public function getToolHarvestLevel() : int{ return TieredTool::TIER_IRON; } public function getDropsForCompatibleTool(Item $item) : array{ return [ ItemFactory::get(Item::REDSTONE_DUST, 0, mt_rand(4, 5)) ]; } protected function getXpDropAmount() : int{ return mt_rand(1, 5); } }