22declare(strict_types=1);
24namespace pocketmine\block\utils;
28trait AnalogRedstoneSignalEmitterTrait{
29 protected int $signalStrength = 0;
31 protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
32 $w->boundedIntAuto(0, 15, $this->signalStrength);
35 public function getOutputSignalStrength() : int{ return $this->signalStrength; }
38 public function setOutputSignalStrength(
int $signalStrength) : self{
39 if($signalStrength < 0 || $signalStrength > 15){
40 throw new \InvalidArgumentException(
"Signal strength must be in range 0-15");
42 $this->signalStrength = $signalStrength;