本文整理匯總了PHP中BukkitPE\item\Item::getFuelTime方法的典型用法代碼示例。如果您正苦於以下問題:PHP Item::getFuelTime方法的具體用法?PHP Item::getFuelTime怎麽用?PHP Item::getFuelTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類BukkitPE\item\Item
的用法示例。
在下文中一共展示了Item::getFuelTime方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: checkFuel
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);
}
}