protected function checkFuel(Item $fuel) { $this->server->getPluginManager()->callEvent($ev = new FurnaceBurnEvent($this, $fuel, $fuel->getFuelTime())); if ($ev->isCancelled()) { return; } $this->namedtag->MaxTime = new Short("MaxTime", $ev->getBurnTime()); $this->namedtag->BurnTime = new Short("BurnTime", $ev->getBurnTime()); $this->namedtag->BurnTicks = new Short("BurnTicks", 0); if ($this->getBlock()->getId() === Item::FURNACE) { $this->getLevel()->setBlock($this, Block::get(Item::BURNING_FURNACE, $this->getBlock()->getDamage()), true); } if ($this->namedtag["BurnTime"] > 0 and $ev->isBurning()) { $fuel->setCount($fuel->getCount() - 1); if ($fuel->getCount() === 0) { $fuel = Item::get(Item::AIR, 0, 0); } $this->inventory->setFuel($fuel); } }