mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-08-26 05:04:57 +00:00
RedstoneLamp: implement Lightable, shimmed to powered
This commit is contained in:
parent
e824266457
commit
47140cb8d7
@ -23,11 +23,12 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace pocketmine\block;
|
namespace pocketmine\block;
|
||||||
|
|
||||||
|
use pocketmine\block\utils\Lightable;
|
||||||
use pocketmine\block\utils\PoweredByRedstone;
|
use pocketmine\block\utils\PoweredByRedstone;
|
||||||
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
use pocketmine\block\utils\PoweredByRedstoneTrait;
|
||||||
use pocketmine\data\runtime\RuntimeDataDescriber;
|
use pocketmine\data\runtime\RuntimeDataDescriber;
|
||||||
|
|
||||||
class RedstoneLamp extends Opaque implements PoweredByRedstone{
|
class RedstoneLamp extends Opaque implements PoweredByRedstone, Lightable{
|
||||||
use PoweredByRedstoneTrait;
|
use PoweredByRedstoneTrait;
|
||||||
|
|
||||||
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
|
||||||
@ -37,4 +38,14 @@ class RedstoneLamp extends Opaque implements PoweredByRedstone{
|
|||||||
public function getLightLevel() : int{
|
public function getLightLevel() : int{
|
||||||
return $this->powered ? 15 : 0;
|
return $this->powered ? 15 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function isLit() : bool{
|
||||||
|
return $this->powered;
|
||||||
|
}
|
||||||
|
|
||||||
|
/** @return $this */
|
||||||
|
public function setLit(bool $lit = true) : self{
|
||||||
|
$this->powered = $lit;
|
||||||
|
return $this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user