22declare(strict_types=1);
27use pocketmine\block\utils\FacesOppositePlacingPlayerTrait;
28use pocketmine\block\utils\LightableTrait;
29use pocketmine\crafting\FurnaceType;
37 use FacesOppositePlacingPlayerTrait;
40 protected FurnaceType $furnaceType;
43 $this->furnaceType = $furnaceType;
44 parent::__construct($idInfo, $name, $typeInfo);
48 $w->horizontalFacing($this->facing);
52 public function getFurnaceType() : FurnaceType{
53 return $this->furnaceType;
57 return $this->lit ? 13 : 0;
61 if($player instanceof
Player){
62 $furnace = $this->position->getWorld()->getTile($this->position);
63 if($furnace instanceof TileFurnace && $furnace->canOpenWith($item->getCustomName())){
64 $player->setCurrentWindow($furnace->getInventory());
72 $world = $this->position->getWorld();
73 $furnace = $world->getTile($this->position);
74 if($furnace instanceof TileFurnace && $furnace->onUpdate()){
75 if(mt_rand(1, 60) === 1){
76 $world->addSound($this->position, $furnace->getFurnaceType()->getCookSound());
78 $world->scheduleDelayedBlockUpdate($this->position, 1);
describeBlockOnlyState(RuntimeDataDescriber $w)
onInteract(Item $item, int $face, Vector3 $clickVector, ?Player $player=null, array &$returnedItems=[])