furnaceType = $furnaceType; parent::__construct($idInfo, $name, $typeInfo); } protected function describeBlockOnlyState(RuntimeDataDescriber $w) : void{ $w->enum($this->facing); $w->bool($this->lit); } public function getFurnaceType() : FurnaceType{ return $this->furnaceType; } public function getLightLevel() : int{ return $this->lit ? 13 : 0; } protected function newMenu(Player $player, Inventory $inventory, Position $position) : InventoryWindow{ return new FurnaceInventoryWindow($player, $inventory, $position, $this->furnaceType); } public function onScheduledUpdate() : void{ $world = $this->position->getWorld(); $furnace = $world->getTile($this->position); if($furnace instanceof TileFurnace && $furnace->onUpdate()){ if(mt_rand(1, 60) === 1){ //in vanilla this is between 1 and 5 seconds; try to average about 3 $world->addSound($this->position, $furnace->getFurnaceType()->getCookSound()); } $world->scheduleDelayedBlockUpdate($this->position, 1); //TODO: check this } } }