22declare(strict_types=1);
 
   24namespace pocketmine\block\utils;
 
   33    protected int $age = 0;
 
   35    protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{
 
   36        $w->boundedIntAuto(0, self::MAX_AGE, $this->age);
 
   39    public function getAge() : int{ return $this->age; }
 
   41    public function getMaxAge() : int{ return self::MAX_AGE; }
 
   46    public function setAge(
int $age) : self{
 
   47        if($age < 0 || $age > self::MAX_AGE){
 
   48            throw new \InvalidArgumentException(
"Age must be in range 0 ... " . self::MAX_AGE);